'use client';
import React, { useState, useEffect } from 'react';
import { Layout, Drawer } from 'antd';
import { motion, AnimatePresence } from 'framer-motion';
import { MenuIcon, XIcon, ArrowRightIcon } from 'lucide-react';
import { cn } from '@/utils/cn';
import { Button } from '@/components/ui/Button';
const { Header: AntHeader } = Layout;
interface NavigationItem {
key: string;
label: string;
href: string;
}
const navigationItems: NavigationItem[] = [
{ key: 'home', label: 'Home', href: '/' },
{ key: 'services', label: 'Services', href: '/services' },
{ key: 'components', label: 'Components', href: '/components' },
{ key: 'technical-specs', label: 'Technical Specs', href: '/technical-specs' },
{ key: 'pricing', label: 'Pricing', href: '/pricing' },
{ key: 'docs', label: 'Documentation', href: '/docs' },
{ key: 'about', label: 'About', href: '/about' },
];
export const Header: React.FC = () => {
const [isScrolled, setIsScrolled] = useState(false);
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
const [activeKey, setActiveKey] = useState('home');
// Handle scroll effect
useEffect(() => {
const handleScroll = () => {
setIsScrolled(window.scrollY > 20);
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);
// Handle navigation click
const handleNavClick = (href: string, key: string) => {
setActiveKey(key);
setIsMobileMenuOpen(false);
// In a real app, you'd use Next.js router here
// router.push(href);
};
// Mobile menu animation variants
const drawerVariants = {
closed: { opacity: 0 },
open: { opacity: 1 },
};
const menuItemVariants = {
closed: { x: -20, opacity: 0 },
open: (i: number) => ({
x: 0,
opacity: 1,
transition: { delay: i * 0.1 },
}),
};
return (
<>