Files
zeekay 3aaf80ad3f Update content for Parsis Foundation
- Transform from personal site to foundation/NGO site
- Focus on education, research, AI, cryptography, open governance
- Update all translations and navigation
- Update package.json metadata
2026-02-04 18:35:04 -08:00

25 lines
795 B
TypeScript

'use client';
import { useI18n } from '@/lib/i18n/context';
import { Locale } from '@/lib/i18n';
export function LanguageSwitcher() {
const { locale, setLocale } = useI18n();
const toggleLocale = () => {
setLocale(locale === 'en' ? 'fa' : 'en');
};
return (
<button
onClick={toggleLocale}
className="flex items-center gap-2 rounded-lg border border-white/10 bg-card/50 px-3 py-1.5 text-sm transition-colors hover:bg-card"
aria-label={locale === 'en' ? 'Switch to Farsi' : 'Switch to English'}
>
<span className={locale === 'en' ? 'text-gold' : 'text-muted-foreground'}>EN</span>
<span className="text-muted-foreground">/</span>
<span className={locale === 'fa' ? 'text-gold' : 'text-muted-foreground'}>فا</span>
</button>
);
}