import Link from "next/link"; import type { ReactNode } from "react"; import { content } from "@/lib/content"; import { CartTrigger } from "./CartTrigger"; import { MobileNavDialog } from "./MobileNavDialog"; import { PredictiveSearchTrigger } from "./PredictiveSearchTrigger"; /** Maps a header nav item to its route. "Collections" -> the collections * index; the category items -> their collection PLP. */ const navItemHref: Record<(typeof content.header.navItems)[number], string> = { Collections: "/collections", Men: "/collections/men", Women: "/collections/women", Accessories: "/collections/accessories", }; /** * Site header — server shell + small client islands (engineering.md F7; * `hydrogen-setup` / `references/navbar.md`). Server-rendered: logo ``, * desktop nav ``s, and a real `` search trigger * (server-rendered, F4 — reachable without JS). Client islands: `CartTrigger` * (`showModal()` button, cart count), `PredictiveSearchTrigger` (hydrates * the `/search` link into the modal trigger), `MobileNavDialog` (`` with * an always-rendered fallback link list). * * The cart trigger opens the `` drawer via `showModal()` * (hydrogen-cart-drawer) — NO `hasHydrated` anchor/button swap (feedback * Round 4 #3). The footer `/cart` link is the no-JS cart fallback. */ export function Header({ accountLink }: { accountLink?: ReactNode }) { return (
CORE
{accountLink}
); }