'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; import { cn } from '$shared/lib'; import type { NavItem } from '../model/types'; /** * Props for MobileNav. */ interface Props { /** * Navigation items to render */ items: NavItem[]; } /** * Mobile navigation overlay, hidden on lg+ screens. * Closes automatically when the URL pathname changes after navigation. */ export function MobileNav({ items }: Props) { const [isOpen, setIsOpen] = useState(false); const pathname = usePathname(); // biome-ignore lint/correctness/useExhaustiveDependencies: pathname is the trigger, not a value used inside the callback useEffect(() => { setIsOpen(false); }, [pathname]); return (

allmy.work

{isOpen && (
{items.map((item) => (
{item.number} {item.label}
))}
)}
); }