roadrecon / frontend /src /components /LanguageSwitcher.tsx
k25kar's picture
redesign: government-portal UI, unified branding, multilingual (EN/HI/MR)
89b98d8
Raw
History Blame Contribute Delete
648 Bytes
import { LANGS, useT } from "../lib/i18n";
export default function LanguageSwitcher() {
const { lang, setLang } = useT();
return (
<div className="inline-flex overflow-hidden rounded-md border border-line">
{LANGS.map((l) => (
<button
key={l.code}
onClick={() => setLang(l.code)}
className={`px-2.5 py-1 text-xs font-semibold transition ${
lang === l.code
? "bg-gov-600 text-white"
: "bg-white text-ink-soft hover:bg-paper"
}`}
aria-pressed={lang === l.code}
>
{l.label}
</button>
))}
</div>
);
}