import { SaveButton } from "@/components/Common/SaveButton"
import { getSearchSettings, setSearchSettings } from "@/services/search"
import { getTTSSettings, setTTSSettings } from "@/services/tts"
import { SUPPORTED_SERACH_PROVIDERS } from "@/utils/search-provider"
import { useForm } from "@mantine/form"
import { useQuery, useQueryClient } from "@tanstack/react-query"
import { Select, Skeleton, Switch, InputNumber } from "antd"
import { useTranslation } from "react-i18next"
export const TTSModeSettings = ({ hideTitle }: { hideTitle?: boolean }) => {
const { t } = useTranslation("settings")
const queryClient = useQueryClient()
const form = useForm({
initialValues: {
ttsEnabled: false,
ttsProvider: "",
voice: "",
ssmlEnabled: false
}
})
const { status, data } = useQuery({
queryKey: ["fetchTTSSettings"],
queryFn: async () => {
const data = await getTTSSettings()
form.setValues(data)
return data
}
})
if (status === "pending" || status === "error") {
return