'use client'; import { useTranslations, useLocale } from 'next-intl'; import { Link, usePathname, useRouter } from '@/i18n/routing'; import { useState, useEffect } from 'react'; import { clsx, type ClassValue } from 'clsx'; import { twMerge } from 'tailwind-merge'; import { Menu, X, Globe } from 'lucide-react'; function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } export default function Navbar() { const t = useTranslations('Navbar'); const locale = useLocale(); const pathname = usePathname(); const router = useRouter(); const [isScrolled, setIsScrolled] = useState(false); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 20); }; window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []); const toggleLanguage = () => { const nextLocale = locale === 'tr' ? 'en' : 'tr'; router.replace(pathname, { locale: nextLocale }); }; const navLinks = [ { href: '/', label: t('villas') }, { href: '/about', label: t('about') }, { href: '/contact', label: t('contact') }, ]; return ( ); }