"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState, useEffect, useRef } from "react"; const PRIMARY = [ { href: "/", label: "ζ€»θ§ˆ", icon: "🏠" }, { href: "/standings", label: "η§―εˆ†ζ¦œ", icon: "πŸ“‹" }, { href: "/watch", label: "θ§‚θ΅›ζŒ‡ε—", icon: "πŸ“Ί" }, { href: "/predict", label: "ζ―”εˆ†ι’„ζ΅‹", icon: "🎯" }, { href: "/value", label: "η«žε½©δ»·ε€Ό", icon: "πŸ’°" }, ]; const MORE = [ { href: "/simulator", label: "θ΅›δΊ‹ζ¨‘ζ‹Ÿ", icon: "πŸ†" }, { href: "/calibration", label: "ζ¨‘εž‹ζ ‘ε‡†", icon: "πŸ“Š" }, ]; export default function Nav() { const path = usePathname(); const [open, setOpen] = useState(false); const ref = useRef(null); useEffect(() => setOpen(false), [path]); useEffect(() => { const h = (e: MouseEvent) => { if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false); }; document.addEventListener("click", h); return () => document.removeEventListener("click", h); }, []); const cls = (active: boolean) => `whitespace-nowrap rounded-lg px-3 py-1.5 text-sm transition ${ active ? "bg-gold/15 text-gold" : "text-white/60 hover:bg-white/5 hover:text-white" }`; const isActive = (href: string) => (href === "/" ? path === "/" : path.startsWith(href)); const moreActive = MORE.some((l) => isActive(l.href)); return (
⚽ World Cup 2026 {/* primary links: scroll horizontally on small screens */} {/* ζ›΄ε€š dropdown β€” OUTSIDE the overflow nav so it isn't clipped */}
{open && (
{MORE.map((l) => ( {l.icon} {l.label} ))}
)}
); }