"use client"; import { useState } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Menu, X, Map as MapIcon } from "lucide-react"; import { Logo } from "@/components/logo"; import { ThemeToggle } from "@/components/theme/theme-toggle"; import { UserMenu } from "@/components/user-menu"; import { TRACKS } from "@/lib/tracks"; import { useUser } from "@/lib/use-user"; import { cn } from "@/lib/utils"; // "My roadmap" gets a quiet outlined pill so it's easy to find without shouting function RoadmapPill({ active, onClick }: { active: boolean; onClick?: () => void }) { return ( My roadmap ); } const NAV_LINKS = [ { href: "/getting-started", label: "Start here" }, { href: "/tutorials", label: "Tutorials" }, { href: "/videos", label: "Videos" }, ]; export function SiteHeader() { const pathname = usePathname(); const [open, setOpen] = useState(false); const { user } = useUser(); const linkClass = (href: string) => cn( "whitespace-nowrap font-mono text-[12.5px] font-medium uppercase tracking-[0.07em] transition-colors hover:text-foreground", pathname === href || pathname.startsWith(`${href}/`) ? "text-foreground" : "text-[var(--ash)]" ); return ( {NAV_LINKS.map((l) => ( {l.label} ))} {pathname !== "/" && } setOpen(!open)} aria-label={open ? "Close menu" : "Open menu"} aria-expanded={open} aria-controls="airp-mobile-nav" > {open ? : } {open && ( setOpen(false)} /> {/* The header bar drops the theme toggle on phones, and the sign-in pill on the narrowest ones */} {!user && ( setOpen(false)}> Sign in )} {[...NAV_LINKS, ...TRACKS.map((t) => ({ href: `/${t.slug}`, label: t.name }))].map((l) => ( setOpen(false)}> {l.label} ))} {pathname !== "/" && ( Theme )} )} ); }