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

Function content

src/ui-solid-dom/common/components.tsx:78–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 },
77) => {
78 const content = () => {
79 const [
80 cells,
81 cellComponentProps,
82 rowIds,
83 extraCellsBefore,
84 extraCellsAfter,
85 sortAndOffset,
86 handleSort,
87 paginatorComponent,
88 ] = props.params;
89 const sort: SortAndOffset | [] =
90 sortAndOffset == null ? [] : getValue(sortAndOffset);
91 const paginator = getValue(paginatorComponent);
92 return (
93 <table class={props.className}>
94 {paginator ? <caption>{paginator}</caption> : null}
95 {props.headerRow === false ? null : (
96 <thead>
97 <tr>
98 {extraHeaders(extraCellsBefore)}
99 {props.idColumn === false
100 ? null
101 : HtmlHeaderCell({sort, label: 'Id', onClick: handleSort})}
102 {objToArray(getValue(cells), ({label}, cellId) =>
103 HtmlHeaderCell({
104 cellId,
105 label,
106 sort,
107 onClick: handleSort,
108 }),
109 )}
110 {extraHeaders(extraCellsAfter)}
111 </tr>
112 </thead>
113 )}
114 <tbody>
115 {arrayMap(getValue(rowIds), (rowId) => {
116 const rowProps = {...(cellComponentProps as any), rowId};
117 return (
118 <tr>
119 {extraRowCells(extraCellsBefore, rowProps)}
120 {isFalse(props.idColumn) ? null : (
121 <th title={rowId}>{rowId}</th>
122 )}
123 {objToArray(
124 getValue(cells),
125 ({component: CellView, getComponentProps}, cellId) => (
126 <td>
127 <CellView
128 {...getProps(getComponentProps, rowId, cellId)}
129 {...rowProps}
130 cellId={cellId}
131 />
132 </td>
133 ),
134 )}
135 {extraRowCells(extraCellsAfter, rowProps)}

Callers 2

HtmlTableFunction · 0.70
EditableThingFunction · 0.70

Calls 9

getValueFunction · 0.90
extraHeadersFunction · 0.90
objToArrayFunction · 0.90
arrayMapFunction · 0.90
extraRowCellsFunction · 0.90
isFalseFunction · 0.90
getPropsFunction · 0.90
HtmlHeaderCellFunction · 0.70
widgetFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…