"use client"; /** * NavLink — primary-nav link with an active-page indicator. * * Reads usePathname to decide whether this link points at the active route, * then renders a visible gold underline plus a brighter text colour and * sets `aria-current="page"` for screen readers. A link counts as active for * its exact path AND for descendant paths (e.g. /sightings is active when * on /sightings/EV-1947-…), so deep pages still highlight their section. */ import Link from "next/link"; import { usePathname } from "next/navigation"; export function NavLink({ href, label }: { href: string; label: string }) { const pathname = usePathname() || "/"; const isActive = pathname === href || (href !== "/" && pathname.startsWith(`${href}/`)); return ( {label} ); }