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

Function EditableValueView

src/ui-solid-dom/EditableValueView.tsx:11–31  ·  view source on GitHub ↗
(
  props: ValueProps & {
    readonly className?: string;
    readonly showType?: boolean;
  },
)

Source from the content-addressed store, hash-verified

9import {EDITABLE} from './common/index.tsx';
10
11export const EditableValueView: typeof EditableValueViewDecl = (
12 props: ValueProps & {
13 readonly className?: string;
14 readonly showType?: boolean;
15 },
16): JSXElement => {
17 const [value, setValue] = useValueState(
18 () => props.valueId,
19 () => props.store,
20 );
21 const store = useStoreOrStoreById(() => props.store);
22 return EditableThing({
23 get thing() {
24 return value();
25 },
26 onThingChange: setValue,
27 class: props.className ?? EDITABLE + VALUE,
28 showType: props.showType,
29 hasSchema: () => !!store()?.hasValuesSchema(),
30 });
31};

Callers

nothing calls this directly

Calls 5

useValueStateFunction · 0.90
useStoreOrStoreByIdFunction · 0.90
EditableThingFunction · 0.90
hasValuesSchemaMethod · 0.65
storeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…