(props: MenuItemProps)
| 31 | } |
| 32 | |
| 33 | export function MenuItem(props: MenuItemProps) { |
| 34 | let textValue = |
| 35 | props.textValue || (typeof props.children === 'string' ? props.children : undefined); |
| 36 | return ( |
| 37 | <AriaMenuItem textValue={textValue} {...props} className={dropdownItemStyles}> |
| 38 | {composeRenderProps(props.children, (children, {selectionMode, isSelected, hasSubmenu}) => ( |
| 39 | <> |
| 40 | {selectionMode !== 'none' && ( |
| 41 | <span className="flex items-center w-4"> |
| 42 | {isSelected && <Check aria-hidden className="w-4 h-4" />} |
| 43 | </span> |
| 44 | )} |
| 45 | <span className="flex items-center flex-1 gap-2 font-normal truncate group-selected:font-semibold"> |
| 46 | {children} |
| 47 | </span> |
| 48 | {hasSubmenu && <ChevronRight aria-hidden className="absolute w-4 h-4 right-2" />} |
| 49 | </> |
| 50 | ))} |
| 51 | </AriaMenuItem> |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | export function MenuSeparator(props: SeparatorProps) { |
| 56 | return ( |
nothing calls this directly
no test coverage detected