"use client"; import { LOCALES, LOCALE_LABELS, LOCALE_COOKIE, isLocale, type Locale } from "@/lib/i18n/locales"; function writeLocaleCookie(locale: Locale): void { document.cookie = `${LOCALE_COOKIE}=${locale}; path=/; max-age=31536000; SameSite=Lax`; } export function LanguageSwitcher({ current }: { current: Locale }) { function switchTo(locale: Locale) { if (locale === current || !isLocale(locale)) { return; } writeLocaleCookie(locale); window.location.reload(); } return (
{LOCALES.map((locale) => ( ))}
); }