({title, children, defaultExpanded})
| 66 | }); |
| 67 | |
| 68 | export function DisclosureRow({title, children, defaultExpanded}) { |
| 69 | let state = useDisclosureState({defaultExpanded}); |
| 70 | let ref = useRef(null); |
| 71 | let {buttonProps} = useDisclosure({}, state, ref); |
| 72 | // oxlint-disable-next-line react/react-compiler |
| 73 | delete buttonProps['aria-controls']; // there is no panel element in this implementation |
| 74 | |
| 75 | return ( |
| 76 | <TableBody> |
| 77 | <TableRow> |
| 78 | <td colSpan={3} className={tableCell}> |
| 79 | <Button |
| 80 | {...buttonProps} |
| 81 | className={p => buttonStyles({...p, isExpanded: state.isExpanded})}> |
| 82 | {/* @ts-ignore */} |
| 83 | <Chevron styles={chevronStyles({isExpanded: state.isExpanded})} /> |
| 84 | {title} |
| 85 | </Button> |
| 86 | </td> |
| 87 | </TableRow> |
| 88 | {state.isExpanded && children} |
| 89 | </TableBody> |
| 90 | ); |
| 91 | } |
nothing calls this directly
no test coverage detected