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

Function QueryView

src/ui-react-inspector/QueriesView.tsx:23–60  ·  view source on GitHub ↗
({
  queries,
  queriesId,
  queryId,
  s,
}: {
  readonly queries?: Queries | undefined;
  readonly queriesId?: Id;
  readonly queryId: Id;
} & StoreProp)

Source from the content-addressed store, hash-verified

21import {Details} from './Details.tsx';
22
23const QueryView = ({
24 queries,
25 queriesId,
26 queryId,
27 s,
28}: {
29 readonly queries?: Queries | undefined;
30 readonly queriesId?: Id;
31 readonly queryId: Id;
32} & StoreProp) => {
33 const uniqueId = getUniqueId('q', queriesId, queryId);
34 const [cellId, descending, offset] = jsonParse(
35 (useCell(STATE_TABLE, uniqueId, SORT_CELL, s) as string) ?? '[]',
36 );
37 const handleChange = useSetCellCallback(
38 STATE_TABLE,
39 uniqueId,
40 SORT_CELL,
41 jsonStringWithMap,
42 [],
43 s,
44 );
45 return (
46 <Details uniqueId={uniqueId} title={'Query: ' + queryId} s={s}>
47 <ResultSortedTableInHtmlTable
48 queryId={queryId}
49 queries={queries}
50 cellId={cellId}
51 descending={descending}
52 offset={offset}
53 limit={10}
54 paginator={true}
55 sortOnClick={true}
56 onChange={handleChange}
57 />
58 </Details>
59 );
60};
61
62export const QueriesView = ({
63 queriesId,

Callers

nothing calls this directly

Calls 3

getUniqueIdFunction · 0.90
useCellFunction · 0.90
useSetCellCallbackFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…