MCPcopy Index your code
hub / github.com/tinyplex/tinybase / Details

Function Details

src/ui-solid-inspector/index.tsx:151–185  ·  view source on GitHub ↗
(
  props: {
    readonly uniqueId: Id;
    readonly title: JSXElement;
    readonly editable?: Accessor<boolean>;
    readonly handleEditable?: (event: MouseEvent) => void;
  } & ChildrenProp &
    StoreProp,
)

Source from the content-addressed store, hash-verified

149};
150
151const Details = (
152 props: {
153 readonly uniqueId: Id;
154 readonly title: JSXElement;
155 readonly editable?: Accessor<boolean>;
156 readonly handleEditable?: (event: MouseEvent) => void;
157 } & ChildrenProp &
158 StoreProp,
159) => {
160 const open = useCell(STATE_TABLE, props.uniqueId, OPEN_CELL, props.s);
161 const handleToggle = (event: Event & {currentTarget: HTMLDetailsElement}) =>
162 props.s.setCell(
163 STATE_TABLE,
164 props.uniqueId,
165 OPEN_CELL,
166 event.currentTarget.open,
167 );
168 return (
169 <details open={!!open()} onToggle={handleToggle}>
170 <summary>
171 <span>{props.title}</span>
172 {props.handleEditable ? (
173 <img
174 onClick={props.handleEditable}
175 class={props.editable?.() ? 'done' : 'edit'}
176 title={props.editable?.() ? 'Done editing' : 'Edit'}
177 />
178 ) : (
179 EMPTY_STRING
180 )}
181 </summary>
182 <div>{props.children}</div>
183 </details>
184 );
185};
186
187const ConfirmableActions = <
188 Props extends TableProps | RowProps | CellProps | ValuesProps | ValueProps,

Callers 5

ValuesViewFunction · 0.70
TableViewFunction · 0.70
TablesViewFunction · 0.70
SliceViewFunction · 0.70
RelationshipViewFunction · 0.70

Calls 1

useCellFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…