'use client'; import clsx from 'clsx'; import type { Locale } from 'i18n-config'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; export const LanguageControl = ({ lang }: { lang?: Locale }) => { const pathName = usePathname(); const redirectedPathName = (locale: string) => { if (!pathName) return '/'; const segments = pathName.split('/'); segments[1] = locale; return segments.join('/'); }; return (