import classNames from 'classnames'; import { useRouter } from 'next/router'; import Link from 'next/link'; import styles from './MobileMenu.module.css'; export function MobileMenu({ items = [], onClose }) { const { pathname } = useRouter(); const Items = ({ items, className }) => (
{items.map(({ label, url, children }) => { const selected = pathname.startsWith(url); return ( <> {label} {children && } ); })}
); return (
); } export default MobileMenu;