import { html, nothing, type TemplateResult } from 'lit'; import type { NuiType } from '../../types/nui-type.js'; import type { MenuItem } from './types.js'; export interface NuiMenuViewProps { model: MenuItem[]; popup: boolean; disabled: boolean; menuClass: string; nuiType: NuiType; overlayVisible: boolean; } export interface MenuRenderHandlers { onItemClick: (item: MenuItem, event: Event) => void; } function renderItem( item: MenuItem, handler: (item: MenuItem, event: Event) => void, ): TemplateResult { if (item.visible === false) { return html`${nothing}`; } if (item.separator) { return html`
`; } const hasIcon = !!item.icon; const linkContent = html` ${hasIcon ? html`