"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { AccountMenu } from "@/components/AccountMenu"; import { EnvBadge } from "@/components/EnvBadge"; export type NavLink = { href: string; label: string }; /* * One masthead in three zones: who you are acting as, where you can go, and * which environment you are in. * * It replaces a brand bar and a separate nav strip. The nav's active state is * derived from the pathname rather than hardcoded — the previous customer nav * marked Overview as current on every page, including the ones that weren't it. * * Staff sit on --panel-2 with a chip where the account name goes. web/ is locked * to dark so this app defaults to light for the same reason CLAUDE.md gives: * telling two consoles apart before you click Reissue. Staff and customer need * that distinction from each other too, and one shade plus one chip buys it * without a second palette. */ export function AppBar({ links, context, staff = false, }: { links: NavLink[]; context?: React.ReactNode; staff?: boolean; }) { const pathname = usePathname(); const isCurrent = (href: string) => // The section root matches only exactly; deeper routes match by prefix, // so /staff/accounts/:id still lights Accounts while /staff/accounts // does not light Operations. href === "/" || href === "/staff" ? pathname === href : pathname === href || pathname.startsWith(`${href}/`); return (
Vantage HQ {context && ( <> {context} )}
); }