import Link from 'next/link' import { ReactNode } from 'react' import { Badge, Button, Menu } from 'ui' interface ProductMenuItemProps { name: string | ReactNode isActive: boolean isExternal?: boolean icon?: ReactNode rightIcon?: ReactNode url?: string target?: '_blank' | '_self' onClick?: () => void textClassName?: string hoverText?: string label?: string } const ProductMenuItem = ({ name = '', isActive, isExternal, icon, rightIcon, url = '', target = '_self', onClick, textClassName = '', hoverText = '', label, }: ProductMenuItemProps) => { const menuItem = (
{name} {label !== undefined && {label}}
{rightIcon &&
{rightIcon}
}
) if (url) { if (isExternal) { return ( ) } return ( {menuItem} ) } return menuItem } export default ProductMenuItem