"use client"; import { useRouter } from "next/navigation"; import { LOCALES, LOCALE_LABELS, type Locale } from "@/lib/i18n/locales"; import { setLocaleCookie } from "@/lib/i18n/set-locale-cookie"; export function LanguageSwitcher({ current }: { current: Locale }) { const router = useRouter(); async function switchTo(locale: Locale) { if (locale === current) { return; } await setLocaleCookie(locale); router.refresh(); } return (
{LOCALES.map((locale) => ( ))}
); }