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

Function RelationshipInHtmlRow

src/ui-react-dom/RelationshipInHtmlTable.tsx:33–95  ·  view source on GitHub ↗
({
  localRowId,
  params: [
    idColumn,
    cells,
    localTableId,
    remoteTableId,
    relationshipId,
    relationships,
    store,
    extraCellsBefore,
    extraCellsAfter,
  ],
}: {
  readonly localRowId: Id;
  readonly params: RelationshipInHtmlRowParams;
})

Source from the content-addressed store, hash-verified

31 );
32
33export const RelationshipInHtmlRow = ({
34 localRowId,
35 params: [
36 idColumn,
37 cells,
38 localTableId,
39 remoteTableId,
40 relationshipId,
41 relationships,
42 store,
43 extraCellsBefore,
44 extraCellsAfter,
45 ],
46}: {
47 readonly localRowId: Id;
48 readonly params: RelationshipInHtmlRowParams;
49}) => {
50 const remoteRowId = useRemoteRowId(
51 relationshipId,
52 localRowId,
53 relationships,
54 ) as Id;
55 const rowProps: RowProps = {
56 tableId: localTableId ?? '',
57 rowId: localRowId,
58 store,
59 };
60 return (
61 <tr>
62 {extraRowCells(extraCellsBefore, rowProps)}
63 {isFalse(idColumn) ? null : (
64 <>
65 <th title={localRowId}>{localRowId}</th>
66 <th title={remoteRowId}>{remoteRowId}</th>
67 </>
68 )}
69 {objToArray(
70 cells,
71 ({component: CellView, getComponentProps}, compoundCellId) => {
72 const [tableId, cellId] = strSplit(compoundCellId, DOT, 2);
73 const rowId =
74 tableId === localTableId
75 ? localRowId
76 : tableId === remoteTableId
77 ? remoteRowId
78 : undefined;
79 return isUndefined(rowId) ? null : (
80 <td key={compoundCellId}>
81 <CellView
82 {...getProps(getComponentProps, rowId, cellId)}
83 store={store}
84 tableId={tableId}
85 rowId={rowId}
86 cellId={cellId}
87 />
88 </td>
89 );
90 },

Callers

nothing calls this directly

Calls 7

useRemoteRowIdFunction · 0.90
extraRowCellsFunction · 0.90
isFalseFunction · 0.90
objToArrayFunction · 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…