MCPcopy
hub / github.com/buildship-ai/rowy / ArraySubTable

Function ArraySubTable

src/components/fields/ArraySubTable/SideDrawerField.tsx:15–56  ·  view source on GitHub ↗
({
  column,
  _rowy_ref,
}: ISideDrawerFieldProps)

Source from the content-addressed store, hash-verified

13import { useSubTableData } from "./utils";
14
15export 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}

Callers

nothing calls this directly

Calls 2

useSubTableDataFunction · 0.90
getFieldIdFunction · 0.90

Tested by

no test coverage detected