import { changeLocale, SUPPORTED_LOCALES, type SupportedLocale } from '@chat-app/shared/i18n'; import { useTranslation } from 'react-i18next'; const LABELS: Record = { en: 'EN', de: 'DE', }; export function LanguageSwitcher({ compact = false }: { compact?: boolean }) { const { i18n } = useTranslation(); const current = (i18n.resolvedLanguage ?? i18n.language) as SupportedLocale; return (
{SUPPORTED_LOCALES.map((locale) => { const active = locale === current; return ( ); })}
); }