import { Link, useLocation } from 'react-router' import { twMerge } from 'tailwind-merge' import { MENU } from './menu' export const Sidebar = () => { const { pathname } = useLocation() const segments = pathname.split('/') const path = segments.length > 3 ? segments.slice(0, 3).join('/') : pathname return (
{MENU.map(({ group, items }) => (
{group}
{items.map(({ title, url, icon: Icon }) => ( {title} ))}
))}
) }