import Link from "@/components/link"; import { cn } from "@/lib/utils"; const MenuItem = ({ text, href, icon, current, className, ...rest }: React.ComponentProps<"div"> & { text?: string; href?: `/${string}`; icon: React.ReactNode; current?: boolean; }) => { const item = (
{icon} {text && {text}}
); // allow both navigational links and/or other interactive react components (e.g. the theme toggle) if (href) { return ( {item} ); } return item; }; export default MenuItem;