'use client'; import Link from 'next/link'; import { useEffect, useState } from 'react'; type NavLink = { href: string; label: string }; type NavSection = { title: string; links: NavLink[] }; export default function MobileNav({ personalisedLinks, shopBySections, customer, }: { personalisedLinks: NavLink[]; shopBySections: NavSection[]; customer: { name: string | null; email: string } | null; }) { const [open, setOpen] = useState(false); const [expanded, setExpanded] = useState(null); // Lock background scroll while the drawer is open, and always start closed // on route change (this component stays mounted across client-side nav). useEffect(() => { document.body.style.overflow = open ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [open]); const close = () => { setOpen(false); setExpanded(null); }; return (
{open && (
Craft2Prints
)}
); }