'use client'; import { Locale, languages, generateLocalizedPath } from '@/lib/i18n'; interface LanguageSwitcherProps { currentLocale: Locale; availableLocales: Locale[]; articleId: string; } export default function LanguageSwitcher({ currentLocale, availableLocales, articleId }: LanguageSwitcherProps) { const handleLanguageChange = (newLocale: Locale) => { // Set locale cookie document.cookie = `locale=${newLocale}; path=/; max-age=31536000`; // 1 year // Navigate to the new path const newPath = generateLocalizedPath(`news/${articleId}`, newLocale); window.location.href = newPath; }; return (