(props: TreeItemProps)
| 68 | } |
| 69 | |
| 70 | export function TreeItem(props: TreeItemProps) { |
| 71 | return ( |
| 72 | <AriaTreeItem className={itemStyles} textValue={props.title} {...props}> |
| 73 | <AriaTreeItemContent {...props}> |
| 74 | {({selectionMode, selectionBehavior, hasChildItems, isExpanded, isDisabled}) => ( |
| 75 | <div className={`flex items-center`}> |
| 76 | {selectionMode !== 'none' && selectionBehavior === 'toggle' && ( |
| 77 | <Checkbox slot="selection" /> |
| 78 | )} |
| 79 | <div className="shrink-0 w-[calc(calc(var(--tree-item-level)_-_1)_*_calc(var(--spacing)_*_3))]" /> |
| 80 | {hasChildItems ? ( |
| 81 | <Button slot="chevron" className={expandButton({isDisabled})}> |
| 82 | <ChevronRight aria-hidden className={chevron({isExpanded, isDisabled})} /> |
| 83 | </Button> |
| 84 | ) : ( |
| 85 | <div className="shrink-0 w-8 h-8" /> |
| 86 | )} |
| 87 | {props.title} |
| 88 | </div> |
| 89 | )} |
| 90 | </AriaTreeItemContent> |
| 91 | {props.children} |
| 92 | </AriaTreeItem> |
| 93 | ); |
| 94 | } |
nothing calls this directly
no outgoing calls
no test coverage detected