"use client"; import { usePathname } from "next/navigation"; import { useLocale } from "next-intl"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Globe } from "lucide-react"; const languages = [ { code: "ko", label: "νκ΅μ΄", flag: "π°π·" }, { code: "en", label: "English", flag: "πΊπΈ" }, { code: "ja", label: "ζ₯ζ¬θͺ", flag: "π―π΅" }, ]; interface LanguageSelectProps { native?: boolean; } export function LanguageSelect({ native = true }: LanguageSelectProps) { const pathname = usePathname(); const locale = useLocale(); const handleLanguageChange = (newLocale: string) => { // Remove current locale from pathname const pathnameWithoutLocale = pathname.replace(`/${locale}`, ""); // Force full page reload to ensure clean state and proper i18n loading window.location.href = `/${newLocale}${pathnameWithoutLocale}`; }; const currentLanguage = languages.find((lang) => lang.code === locale); // λ€μ΄ν°λΈ select if (native) { return (