import { ChevronRight } from 'lucide-react' import Link from 'next/link' import React from 'react' import { Badge, cn } from 'ui' import { isCrossZoneHref } from '@/lib/cross-zone' const MenuItem = React.forwardRef< React.ElementRef<'a'>, React.ComponentPropsWithoutRef<'a'> & { description?: string icon?: string hasChevron?: boolean hoverColor?: 'foreground' | 'brand' badge?: { label: string variant?: 'default' | 'warning' | 'success' | 'destructive' | 'secondary' } } >( ( { className, title, href = '', description, icon, hasChevron, children, hoverColor = 'foreground', badge, ...props }, ref ) => { const content = children ?? ( <> {icon && (
)}

{title}

{badge && {badge.label}} {hasChevron && ( )}
{description && (

{description}

)}
) const linkClassName = cn( 'group/menu-item flex items-center text-foreground-light text-sm hover:text-foreground select-none gap-3 rounded-md p-2 leading-none no-underline focus-ring focus-visible:text-foreground', description && 'items-center', className ) return isCrossZoneHref(href) ? ( {content} ) : ( {content} ) } ) export default MenuItem