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

Function CloneValue

src/ui-react-inspector/actions/values.tsx:78–94  ·  view source on GitHub ↗
({onDone, valueId, store}: OnDoneProp & ValueProps)

Source from the content-addressed store, hash-verified

76// --
77
78const CloneValue = ({onDone, valueId, store}: OnDoneProp & ValueProps) => {
79 const has = useHasValueCallback(store);
80 return (
81 <NewId
82 onDone={onDone}
83 suggestedId={getNewIdFromSuggestedId(valueId, has)}
84 has={has}
85 set={useSetValueCallback(
86 (newId: Id) => newId,
87 (_, store) => store.getValue(valueId) ?? '',
88 [valueId],
89 store,
90 )}
91 prompt="Clone value to"
92 />
93 );
94};
95
96const DeleteValue = ({onDone, valueId, store}: OnDoneProp & ValueProps) => (
97 <Delete

Callers

nothing calls this directly

Calls 4

getNewIdFromSuggestedIdFunction · 0.90
useSetValueCallbackFunction · 0.90
useHasValueCallbackFunction · 0.70
getValueMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…