mirror of
https://github.com/guezoloic/website.git
synced 2026-03-28 18:03:50 +00:00
22 lines
526 B
TypeScript
22 lines
526 B
TypeScript
import Button from '@app/components/ui/Button';
|
|
|
|
import i18n from "@app/lib/i18n";
|
|
|
|
export default function Lang() {
|
|
const toggleLanguage = () => {
|
|
const newLang = i18n.language === "fr" ? "en" : "fr";
|
|
i18n.changeLanguage(newLang);
|
|
};
|
|
|
|
const nextLangLabel = i18n.language === "fr" ? "EN" : "FR";
|
|
|
|
return (
|
|
<Button
|
|
onClick={toggleLanguage}
|
|
label={`Lang: ${nextLangLabel}`}
|
|
variant="icon"
|
|
>
|
|
{nextLangLabel}
|
|
</Button>
|
|
)
|
|
} |