diff --git a/ui/src/components/VoiceModeToggle.tsx b/ui/src/components/VoiceModeToggle.tsx new file mode 100644 index 00000000..9c5b518e --- /dev/null +++ b/ui/src/components/VoiceModeToggle.tsx @@ -0,0 +1,59 @@ +import { useState } from "react"; +import { useVoiceMode } from "@/hooks/useVoiceMode"; + +type VoiceMode = "text" | "voice_input" | "full_voice"; + +const PILLS: { label: string; value: VoiceMode }[] = [ + { label: "Text", value: "text" }, + { label: "Voice In", value: "voice_input" }, + { label: "Full Voice", value: "full_voice" }, +]; + +export function VoiceModeToggle() { + const { mode, setMode, isLoading } = useVoiceMode(); + const [autoPlay, setAutoPlay] = useState( + () => localStorage.getItem("nexus:voice:autoplay") === "true" + ); + + function handleAutoPlayChange(checked: boolean) { + setAutoPlay(checked); + localStorage.setItem("nexus:voice:autoplay", String(checked)); + } + + return ( +
+
+ {PILLS.map(({ label, value }) => ( + + ))} +
+ {mode === "full_voice" && ( + + )} +
+ ); +}