({
column,
_rowy_ref,
}: ISideDrawerFieldProps)
| 13 | import { useSubTableData } from "./utils"; |
| 14 | |
| 15 | export default function ArraySubTable({ |
| 16 | column, |
| 17 | _rowy_ref, |
| 18 | }: ISideDrawerFieldProps) { |
| 19 | const [row] = useAtom( |
| 20 | useMemo( |
| 21 | () => |
| 22 | selectAtom( |
| 23 | tableRowsAtom, |
| 24 | (tableRows) => find(tableRows, ["_rowy_ref.path", _rowy_ref.path]), |
| 25 | isEqual |
| 26 | ), |
| 27 | [_rowy_ref.path] |
| 28 | ), |
| 29 | tableScope |
| 30 | ); |
| 31 | |
| 32 | const { documentCount, label, subTablePath } = useSubTableData( |
| 33 | column as any, |
| 34 | row as any, |
| 35 | _rowy_ref |
| 36 | ); |
| 37 | |
| 38 | return ( |
| 39 | <Stack direction="row" id={getFieldId(column.key)}> |
| 40 | <Box sx={fieldSx}> |
| 41 | {documentCount} {column.name as string}: {label} |
| 42 | </Box> |
| 43 | |
| 44 | <IconButton |
| 45 | component={Link} |
| 46 | to={subTablePath} |
| 47 | edge="end" |
| 48 | size="small" |
| 49 | sx={{ ml: 1 }} |
| 50 | disabled={!subTablePath} |
| 51 | > |
| 52 | <OpenIcon /> |
| 53 | </IconButton> |
| 54 | </Stack> |
| 55 | ); |
| 56 | } |
nothing calls this directly
no test coverage detected