Files
my-links/inertia/components/common/language_switcher.tsx
Sonny 5c37fe9c31 refactor: remove all legacy files
+ comment/delete things that haven't yet migrated to mantine
2024-11-10 00:00:20 +01:00

18 lines
481 B
TypeScript

import { ActionIcon, Image } from '@mantine/core';
import { useTranslation } from 'react-i18next';
export function MantineLanguageSwitcher() {
const { i18n } = useTranslation();
const newLanguage = i18n.language === 'en' ? 'fr' : 'en';
return (
<ActionIcon
variant="light"
aria-label="Toggle color scheme"
onClick={() => i18n.changeLanguage(newLanguage)}
size="lg"
>
<Image src={`/icons/${newLanguage}.svg`} alt={newLanguage} w={18} />
</ActionIcon>
);
}