'use client'; import { usePathname } from 'next/navigation'; import { useState } from 'react'; import { setLocaleAction } from '../app/actions'; import type { Locale } from '../lib/i18n'; type Props = { currentLocale: Locale; label: string; englishLabel: string; indonesianLabel: string; submitLabel: string; variant?: 'default' | 'compact'; }; export function LanguageSwitcher({ currentLocale, label, englishLabel, indonesianLabel, submitLabel, variant = 'default', }: Props) { const pathname = usePathname(); const [locale, setLocale] = useState(currentLocale); if (variant === 'compact') { return (
{label}
); } return (
); }