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

Function AddRow

src/ui-react-inspector/actions/tables.tsx:86–104  ·  view source on GitHub ↗
({onDone, tableId, store}: OnDoneProp & TableProps)

Source from the content-addressed store, hash-verified

84// --
85
86const AddRow = ({onDone, tableId, store}: OnDoneProp & TableProps) => {
87 const has = useHasRowCallback(store, tableId);
88 return (
89 <NewId
90 onDone={onDone}
91 suggestedId={getNewIdFromSuggestedId('row', has)}
92 has={has}
93 set={useSetRowCallback(
94 tableId,
95 (newId) => newId,
96 (_, store) =>
97 objNew(
98 arrayMap(store.getTableCellIds(tableId), (cellId) => [cellId, '']),
99 ),
100 )}
101 prompt="Add row"
102 />
103 );
104};
105
106const CloneTable = ({
107 onDone,

Callers

nothing calls this directly

Calls 6

getNewIdFromSuggestedIdFunction · 0.90
useSetRowCallbackFunction · 0.90
objNewFunction · 0.90
arrayMapFunction · 0.90
useHasRowCallbackFunction · 0.70
getTableCellIdsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…