30 lines
772 B
TypeScript
30 lines
772 B
TypeScript
import { usePage } from "@inertiajs/react";
|
|
|
|
export default function LanguageSwitcher() {
|
|
const { localizedUrls, locale } = usePage<{
|
|
localizedUrls: Record<string, string> | null;
|
|
locale: string;
|
|
}>().props;
|
|
|
|
return (
|
|
<nav className="flex items-center gap-2 font-lato-black text-small text-gris lg:text-[20px] cursor-pointer">
|
|
<a
|
|
href={localizedUrls?.fr}
|
|
className={
|
|
locale === "fr" ? "text-red" : "hover:text-white transition-colors"
|
|
}
|
|
>
|
|
FR
|
|
</a>
|
|
<span className="text-white/40">|</span>
|
|
<a
|
|
href={localizedUrls?.en}
|
|
className={
|
|
locale === "en" ? "text-white" : "hover:text-white transition-colors"
|
|
}
|
|
>
|
|
EN
|
|
</a>
|
|
</nav>
|
|
);
|
|
}
|