"use client"; import { useLocale } from "next-intl"; import { useParams } from "next/navigation"; import { locales } from "@/config"; import { usePathname, useRouter } from "@/i18n/routing"; import { useTransition } from "react"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import Image from "next/image"; export default function LocalSwitcher() { const [isPending, startTransition] = useTransition(); const router = useRouter(); const pathname = usePathname(); const params = useParams(); const localActive = useLocale(); const onSelectChange = (nextLocale: string) => { startTransition(() => { router.replace(pathname, { locale: nextLocale }); }); }; return ( ); }