"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import type { Lang } from "@/lib/i18n"; // KO / EN 토글. 현재 경로 유지 + ?lang 토글. export default function LangSwitch({ lang }: { lang: Lang }) { const pathname = usePathname() || "/"; const href = (l: Lang) => (l === "en" ? `${pathname}?lang=en` : pathname); const langs: Lang[] = ["ko", "en"]; return (
{langs.map((l) => ( {l.toUpperCase()} ))}
); }