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

Function AddRow

src/ui-solid-inspector/index.tsx:372–391  ·  view source on GitHub ↗
(props: OnDoneProp & TableProps)

Source from the content-addressed store, hash-verified

370 });
371
372const AddRow = (props: OnDoneProp & TableProps) => {
373 const has = useHasRowCallback(props.store, props.tableId);
374 return NewId({
375 onDone: props.onDone,
376 suggestedId: getNewIdFromSuggestedId('row', has),
377 has,
378 set: useSetRowCallback(
379 props.tableId,
380 (newId) => newId,
381 (_, store) =>
382 objNew(
383 arrayMap(store.getTableCellIds(props.tableId), (cellId) => [
384 cellId,
385 '',
386 ]),
387 ),
388 ),
389 prompt: 'Add row',
390 });
391};
392
393const CloneTable = (props: OnDoneProp & TableProps) => {
394 const store = useStoreOrStoreById(props.store)();

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…