Vion / frontend /src /components /LanguageToggle.tsx
Vion Deploy
Claude Opus 4.8
Add auth, dashboards, LLM scoring, email notifications, scheduling, and new UI
dd935c0
Raw History Blame Contribute Delete
790 Bytes
import { useI18n, type Language } from "../i18n";
// Switches BOTH the UI language and the spoken call language. The next call
// started after switching uses the selected language for the AI prospect.
export default function LanguageToggle() {
const { language, setLanguage, t } = useI18n();
const options: Language[] = ["en", "de"];
return (
<div className="lang-toggle" role="group" aria-label={t("lang.aria")}>
{options.map((code) => (
<button
key={code}
type="button"
className={language === code ? "active" : ""}
aria-pressed={language === code}
aria-label={t(`lang.${code}`)}
onClick={() => setLanguage(code)}
>
{code.toUpperCase()}
</button>
))}
</div>
);
}