({
children,
...props
}: Omit<GridListItemProps, 'children'> & {
children?: React.ReactNode;
})
| 25 | } |
| 26 | |
| 27 | export function GridListItem({ |
| 28 | children, |
| 29 | ...props |
| 30 | }: Omit<GridListItemProps, 'children'> & { |
| 31 | children?: React.ReactNode; |
| 32 | }) { |
| 33 | let textValue = typeof children === 'string' ? children : undefined; |
| 34 | return ( |
| 35 | <AriaGridListItem textValue={textValue} {...props}> |
| 36 | {({selectionMode, selectionBehavior, allowsDragging}) => ( |
| 37 | <> |
| 38 | {/* Add elements for drag and drop and selection. */} |
| 39 | {allowsDragging && ( |
| 40 | <Button slot="drag"> |
| 41 | <GripVertical size={16} /> |
| 42 | </Button> |
| 43 | )} |
| 44 | {selectionMode === 'multiple' && selectionBehavior === 'toggle' && ( |
| 45 | <Checkbox slot="selection" /> |
| 46 | )} |
| 47 | {children} |
| 48 | </> |
| 49 | )} |
| 50 | </AriaGridListItem> |
| 51 | ); |
| 52 | } |
| 53 | |
| 54 | export function GridListLoadMoreItem(props: GridListLoadMoreItemProps) { |
| 55 | return ( |
nothing calls this directly
no outgoing calls
no test coverage detected