import cn from "../../lib/helpers/classnames"; import Link from "../Link"; import type { ComponentPropsWithoutRef } from "react"; import type { LucideIcon } from "lucide-react"; export type MenuItemProps = Omit, "href"> & { text?: string; href?: string; icon?: LucideIcon; current?: boolean; }; const MenuItem = ({ text, href, icon, current, className, ...rest }: MenuItemProps) => { const Icon = icon; 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;