import { useRouterStore } from '@l-clutch/core'; import { FC, useMemo } from 'react'; export const Menu = () => { const items = lClutchCoreSettings.menuItems; const basicId = lClutchCoreSettings.basicId; return ( ); }; type MenuItemProps = { children: React.ReactNode; path: string; className?: string; }; const MenuItem: FC = ({ children, path, className: aditionalClass }) => { const { getPath, setPath } = useRouterStore(); const nowPath = getPath(0) ?? ''; const isCurrent = useMemo(() => path.replace(/^\//, '') === nowPath, [path, nowPath]); const className = useMemo(() => { const classes = isCurrent ? ['current'] : []; if (aditionalClass) classes.push(aditionalClass); return classes.join(' '); }, [isCurrent]); return (
  • { e.preventDefault(); setPath(path); }} > {children}
  • ); }; type MenuLinkProps = { href: string; children: React.ReactNode; }; const MenuLink: FC = ({ href, children }) => (
  • {children}
  • );