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

Function AddCell

src/ui-react-inspector/actions/tables.tsx:163–190  ·  view source on GitHub ↗
({
  onDone,
  tableId,
  rowId,
  store: storeOrStoreId,
}: OnDoneProp & RowProps)

Source from the content-addressed store, hash-verified

161};
162
163const AddCell = ({
164 onDone,
165 tableId,
166 rowId,
167 store: storeOrStoreId,
168}: OnDoneProp & RowProps) => {
169 const store = useStoreOrStoreById(storeOrStoreId)!;
170 const has = useCallback(
171 (cellId: Id) => store.hasCell(tableId, rowId, cellId),
172 [store, tableId, rowId],
173 );
174 return (
175 <NewId
176 onDone={onDone}
177 suggestedId={getNewIdFromSuggestedId('cell', has)}
178 has={has}
179 set={useSetCellCallback(
180 tableId,
181 rowId,
182 (newId: string) => newId,
183 () => '',
184 [],
185 store,
186 )}
187 prompt="Add cell"
188 />
189 );
190};
191
192const CloneRow = ({
193 onDone,

Callers

nothing calls this directly

Calls 4

useStoreOrStoreByIdFunction · 0.90
getNewIdFromSuggestedIdFunction · 0.90
useSetCellCallbackFunction · 0.90
hasCellMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…