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

Function RelationshipInHtmlRow

src/ui-solid-dom/RelationshipInHtmlTable.tsx:50–110  ·  view source on GitHub ↗
(props: {
  readonly localRowId: Id;
  readonly params: RelationshipInHtmlRowParams;
})

Source from the content-addressed store, hash-verified

48};
49
50export const RelationshipInHtmlRow = (props: {
51 readonly localRowId: Id;
52 readonly params: RelationshipInHtmlRowParams;
53}) => {
54 const [
55 idColumn,
56 cells,
57 localTableId,
58 remoteTableId,
59 relationshipId,
60 relationships,
61 store,
62 extraCellsBefore,
63 extraCellsAfter,
64 ] = props.params;
65 const remoteRowId = useRemoteRowId(
66 () => relationshipId,
67 () => props.localRowId,
68 () => relationships,
69 );
70 const rowProps: RowProps = {
71 tableId: localTableId ?? '',
72 rowId: props.localRowId,
73 store,
74 };
75 return (
76 <tr>
77 {extraRowCells(extraCellsBefore, rowProps)}
78 {isFalse(idColumn) ? null : (
79 <>
80 <th title={props.localRowId}>{props.localRowId}</th>
81 <th title={remoteRowId()}>{remoteRowId()}</th>
82 </>
83 )}
84 {objToArray(
85 getValue(cells),
86 ({component: CellView, getComponentProps}, compoundCellId) => {
87 const [tableId, cellId] = strSplit(compoundCellId, DOT, 2);
88 const rowId =
89 tableId === localTableId
90 ? props.localRowId
91 : tableId === remoteTableId
92 ? remoteRowId()
93 : undefined;
94 return isUndefined(rowId) ? null : (
95 <td>
96 <CellView
97 {...getProps(getComponentProps, rowId, cellId)}
98 store={store}
99 tableId={tableId}
100 rowId={rowId}
101 cellId={cellId}
102 />
103 </td>
104 );
105 },
106 )}
107 {extraRowCells(extraCellsAfter, rowProps)}

Callers 1

contentFunction · 0.70

Calls 8

useRemoteRowIdFunction · 0.90
extraRowCellsFunction · 0.90
isFalseFunction · 0.90
objToArrayFunction · 0.90
getValueFunction · 0.90
strSplitFunction · 0.90
isUndefinedFunction · 0.90
getPropsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…