'use client';
import { useEffect, useState } from 'react';
import { useTranslations, useLocale } from 'next-intl';
import {
Menu,
X,
Home,
User,
Briefcase,
BookOpen,
Phone,
Cog,
} from 'lucide-react';
import Link from 'next/link';
import Image from 'next/image';
import { usePathname } from 'next/navigation';
import { NavLink } from './NavLink';
import LanguageSwitcher from './LanguageSwitcher';
import { ContactInfo } from './ContactInfo';
import { throttle } from '@/utils/throttle';
const Header = () => {
const t = useTranslations('navigation');
const locale = useLocale();
const pathname = usePathname();
const [scrolled, setScrolled] = useState(false);
const [isMenuOpen, setIsMenuOpen] = useState(false);
// Close menu on route change
useEffect(() => {
setIsMenuOpen(false);
}, [pathname]);
// Scroll handler
useEffect(() => {
const handleScroll = throttle(() => {
setScrolled(window.scrollY > 0);
}, 100);
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);
// Prevent body scroll when menu is open
useEffect(() => {
if (isMenuOpen) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = '';
}
return () => {
document.body.style.overflow = '';
};
}, [isMenuOpen]);
const navigationLinks = [
{
path: `/${locale}`,
label: t('main.home'),
icon: