/* MobileNav — hamburger menu for sub-md viewports. * * Reuses the same nav config that the desktop NavigationMenu consumes * (passed in via prop) so the IA stays in sync. Renders as a Sheet * sliding in from the left, with the same active-route treatment * (2 px brand-blue underline). */ 'use client'; import { useState } from 'react'; import Link from 'next/link'; import { Menu } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger, } from '@/components/ui/sheet'; import { Separator } from '@/components/ui/separator'; interface NavItem { title: string; href?: string; icon?: React.ElementType; description?: string; children?: NavItem[]; } interface MobileNavProps { items: NavItem[]; pathname: string; isActive: (href?: string) => boolean; } export function MobileNav({ items, pathname, isActive }: MobileNavProps) { const [open, setOpen] = useState(false); // Close the sheet when the path changes — handles the link click before // useEffect from a route subscription. Effect would also work but this // is simpler and side-effect-free. const handleNav = () => setOpen(false); return ( Pulse

Don't be afraid to cry · Wulf Consulting

); } function MobileNavGroup({ item, isActive, onNav, }: { item: NavItem; isActive: (href?: string) => boolean; onNav: () => void; }) { if (!item.children) { const active = isActive(item.href); return ( {item.icon && } {item.title} ); } const groupActive = item.children.some((c) => isActive(c.href)); return (

{item.icon && } {item.title}

{item.children.map((child) => { const active = isActive(child.href); return ( {child.icon && } {child.title} ); })}
); }