MCPcopy Index your code
hub / github.com/tinyplex/tinybase / SliceView

Function SliceView

src/ui-solid/SliceView.tsx:11–40  ·  view source on GitHub ↗
(props: SliceProps)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

useIndexesOrIndexesByIdFunction · 0.90
useSliceRowIdsFunction · 0.90
contentFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…