Use configured search provider, allow disable internet search

This commit is contained in:
shamoon 2023-01-30 23:38:37 -08:00
parent 4e17628f97
commit 11d03be4de
4 changed files with 24 additions and 17 deletions

View file

@ -3,7 +3,7 @@ import { useTranslation } from "next-i18next";
import { FiSearch } from "react-icons/fi";
import { SiDuckduckgo, SiMicrosoftbing, SiGoogle, SiBaidu, SiBrave } from "react-icons/si";
const providers = {
export const searchProviders = {
google: {
name: "Google",
url: "https://www.google.com/search?q=",
@ -39,7 +39,7 @@ const providers = {
export default function Search({ options }) {
const { t } = useTranslation();
const provider = providers[options.provider];
const provider = searchProviders[options.provider];
const [query, setQuery] = useState("");
if (!provider) {