MCPcopy
hub / github.com/tinyplex/tinybase / SliceView

Function SliceView

src/ui-react/SliceView.tsx:12–40  ·  view source on GitHub ↗
({
  indexId,
  sliceId,
  indexes,
  rowComponent: Row = RowView,
  getRowComponentProps,
  separator,
  debugIds,
}: SliceProps)

Source from the content-addressed store, hash-verified

10import {RowView} from './RowView.tsx';
11
12export const SliceView: typeof SliceViewDecl = ({
13 indexId,
14 sliceId,
15 indexes,
16 rowComponent: Row = RowView,
17 getRowComponentProps,
18 separator,
19 debugIds,
20}: SliceProps): any => {
21 const [resolvedIndexes, store, tableId] = getIndexStoreTableId(
22 useIndexesOrIndexesById(indexes),
23 indexId,
24 );
25 const rowIds = useSliceRowIds(indexId, sliceId, resolvedIndexes);
26 return (
27 <Wrap separator={separator} debugIds={debugIds} id={sliceId}>
28 {arrayMap(rowIds, (rowId) => (
29 <Row
30 key={rowId}
31 {...getProps(getRowComponentProps, rowId)}
32 tableId={tableId as Id}
33 rowId={rowId}
34 store={store}
35 debugIds={debugIds}
36 />
37 ))}
38 </Wrap>
39 );
40};

Callers

nothing calls this directly

Calls 5

getIndexStoreTableIdFunction · 0.90
useIndexesOrIndexesByIdFunction · 0.90
useSliceRowIdsFunction · 0.90
arrayMapFunction · 0.90
getPropsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…