mirror of
https://github.com/guezoloic/website.git
synced 2026-03-31 03:01:37 +00:00
feat: rework entire project structure
This commit is contained in:
22
app/components/ui/LangSwitcher.tsx
Normal file
22
app/components/ui/LangSwitcher.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user