"use client"; import { useEffect, useState } from "react"; import { IconMark } from "./icon-mark"; import { ThemeToggle } from "./theme-toggle"; const navLinks = [ { label: "Features", href: "#features" }, { label: "How It Works", href: "#how-it-works" }, { label: "FAQ", href: "#faq" }, { label: "Download", href: "#download" }, ]; function MenuIcon({ open }: { open: boolean }) { return ( {open ? ( <> > ) : ( <> > )} ); } export function Navbar() { const [mobileOpen, setMobileOpen] = useState(false); const [scrolled, setScrolled] = useState(false); useEffect(() => { const handleScroll = () => setScrolled(window.scrollY > 8); window.addEventListener("scroll", handleScroll, { passive: true }); handleScroll(); return () => window.removeEventListener("scroll", handleScroll); }, []); useEffect(() => { const handleResize = () => { if (window.innerWidth >= 768) { setMobileOpen(false); } }; window.addEventListener("resize", handleResize, { passive: true }); return () => window.removeEventListener("resize", handleResize); }, []); return ( AgentCompany {navLinks.map(({ label, href }) => ( {label} ))} Download setMobileOpen((current) => !current)} aria-label={mobileOpen ? "Close navigation menu" : "Open navigation menu"} aria-expanded={mobileOpen} aria-controls="mobile-nav-menu" className="inline-flex items-center justify-center w-11 h-11 rounded-lg text-[var(--muted)] hover:text-[var(--text)] hover:bg-[var(--panel-soft)] transition-colors duration-200" > {navLinks.map(({ label, href }) => ( setMobileOpen(false)} className="block px-3 py-2.5 rounded-lg text-sm text-[var(--muted)] hover:text-[var(--text)] hover:bg-[var(--panel-soft)] transition-colors duration-200" > {label} ))} setMobileOpen(false)} className="block px-3 py-2.5 rounded-full text-sm font-medium text-center bg-[var(--cta)] text-[var(--text-on-cta)] hover:bg-[var(--cta-hover)] transition-colors duration-200 mt-2" > Download ); }