(props: Omit<MenuItemProps, 'children'> & {children?: React.ReactNode})
| 49 | } |
| 50 | |
| 51 | export function MenuItem(props: Omit<MenuItemProps, 'children'> & {children?: React.ReactNode}) { |
| 52 | let textValue = |
| 53 | props.textValue || (typeof props.children === 'string' ? props.children : undefined); |
| 54 | return ( |
| 55 | <AriaMenuItem {...props} textValue={textValue}> |
| 56 | {({hasSubmenu, isSelected, selectionMode}) => ( |
| 57 | <> |
| 58 | {isSelected && selectionMode === 'multiple' ? <Check /> : null} |
| 59 | {isSelected && selectionMode === 'single' ? <Dot /> : null} |
| 60 | {typeof props.children === 'string' ? ( |
| 61 | <Text slot="label">{props.children}</Text> |
| 62 | ) : ( |
| 63 | props.children |
| 64 | )} |
| 65 | {hasSubmenu && <ChevronRight />} |
| 66 | </> |
| 67 | )} |
| 68 | </AriaMenuItem> |
| 69 | ); |
| 70 | } |
| 71 | |
| 72 | export function MenuSection<T>(props: MenuSectionProps<T>) { |
| 73 | return <AriaMenuSection {...props} />; |
nothing calls this directly
no outgoing calls
no test coverage detected