'use client'; import { useState } from 'react'; import { Locale, languages, generateLocalizedPath, removeLocaleFromPath, } from '@/lib/i18n'; import Link from 'next/link'; import Image from 'next/image'; import { useRouter, usePathname } from 'next/navigation'; interface NavigationProps { locale: Locale; navigation: Array<{ name: string; href: string }>; companyName: string; } export default function Navigation({ locale, navigation, companyName }: NavigationProps) { const [isMenuOpen, setIsMenuOpen] = useState(false); const router = useRouter(); const pathname = usePathname(); const handleLanguageChange = (newLocale: Locale) => { const currentPath = removeLocaleFromPath(pathname); const newPath = generateLocalizedPath(currentPath, newLocale); document.cookie = `locale=${newLocale}; path=/; max-age=31536000`; router.push(newPath); }; return ( ); }