'use client'; // Fixed navigation with language, theme, account, and cart controls. import {useState, useEffect} from 'react'; import Image from 'next/image'; import Link from 'next/link'; import {usePathname} from 'next/navigation'; import {Badge, Button} from 'antd'; import {ShoppingCartOutlined, MenuOutlined, CloseOutlined, UserOutlined} from '@ant-design/icons'; import {useAppSelector} from '@/store/hooks'; import {selectCartCount} from '@/store/cartSlice'; import {useLanguage} from '@/app/context/LanguageContext'; import ThemeToggle from './ThemeToggle'; import LanguageToggle from './LanguageToggle'; export default function Header() { const pathname = usePathname(); const cartCount = useAppSelector(selectCartCount); const {t} = useLanguage(); const [scrolled, setScrolled] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); const navLinks = [ {href: '/#hero', label: t.nav.home}, {href: '/#showcase', label: t.nav.showcase}, {href: '/#about', label: t.nav.about}, {href: '/#locations', label: t.nav.locations}, ]; useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 24); onScroll(); window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, []); console.log( "%c👋 Hamed Abdollahzade · Frontend Developer", "font-size:14px;font-weight:600;" ); return (
setMobileOpen(false)} className="flex items-center gap-2 shrink-0"> روبات مارکت
setMobileOpen(false)} aria-label={t.cart.title} className="w-11 h-11 rounded-full border border-subtle bg-elevated inline-flex items-center justify-center text-xl text-primary hover:text-brand-400">
{mobileOpen && ( )}
); }