"use client"; import { useLocale, useTranslations } from "next-intl"; import { useRouter, usePathname } from "next/navigation"; export function LanguageSwitcher() { const locale = useLocale(); const router = useRouter(); const pathname = usePathname(); const t = useTranslations("footer"); function switchLocale(newLocale: string) { const segments = pathname.split("/"); segments[1] = newLocale; router.push(segments.join("/")); } return (