"use client"; import Link from "next/link"; import { useEffect, useRef, useState } from "react"; import { content } from "@/lib/content"; const navItemHref: Record<(typeof content.header.navItems)[number], string> = { Collections: "/collections", Men: "/collections/men", Women: "/collections/women", Accessories: "/collections/accessories", }; /** * Mobile nav — a `` opened via state, with an always-rendered fallback * link list (F4). The hamburger button is the client trigger; the dialog * contains the same nav items as the desktop nav. Server-rendered baseline is * the hidden dialog content (links are real ``s). */ export function MobileNavDialog() { const [open, setOpen] = useState(false); const dialogRef = useRef(null); useEffect(() => { const dialog = dialogRef.current; if (!dialog) return; if (open && !dialog.open) dialog.showModal(); else if (!open && dialog.open) dialog.close(); }, [open]); return (
setOpen(false)} >
{content.header.mobileNavigation}
); }