import { useRecoilState } from 'recoil'; import { Switch } from '~/components/ui'; import { useLocalize } from '~/hooks'; import store from '~/store'; export default function ConversationModeSwitch({ onCheckedChange, }: { onCheckedChange?: (value: boolean) => void; }) { const localize = useLocalize(); const [conversationMode, setConversationMode] = useRecoilState(store.conversationMode); const [speechToText] = useRecoilState(store.speechToText); const [textToSpeech] = useRecoilState(store.textToSpeech); const [, setAutoSendText] = useRecoilState(store.autoSendText); const [, setDecibelValue] = useRecoilState(store.decibelValue); const [, setAutoTranscribeAudio] = useRecoilState(store.autoTranscribeAudio); const handleCheckedChange = (value: boolean) => { setAutoTranscribeAudio(value); setAutoSendText(value); setDecibelValue(-45); setConversationMode(value); if (onCheckedChange) { onCheckedChange(value); } }; return (
{localize('com_nav_conversation_mode')}
); }