(
props: (RemoteRowProps | LocalRowsProps | LinkedRowsProps) & {
separator?: JSXElement | string;
},
getRowIdsHook: (
relationshipId: Id | (() => Id),
rowId: Id | (() => Id),
relationships: MaybeAccessor<RelationshipsOrRelationshipsId | undefined>,
) => () => Ids,
rowId: Id | (() => Id),
)
| 86 | }; |
| 87 | |
| 88 | export const useComponentPerRow = ( |
| 89 | props: (RemoteRowProps | LocalRowsProps | LinkedRowsProps) & { |
| 90 | separator?: JSXElement | string; |
| 91 | }, |
| 92 | getRowIdsHook: ( |
| 93 | relationshipId: Id | (() => Id), |
| 94 | rowId: Id | (() => Id), |
| 95 | relationships: MaybeAccessor<RelationshipsOrRelationshipsId | undefined>, |
| 96 | ) => () => Ids, |
| 97 | rowId: Id | (() => Id), |
| 98 | ) => { |
| 99 | const resolvedRelationships = useRelationshipsOrRelationshipsById( |
| 100 | () => props.relationships, |
| 101 | ); |
| 102 | const rowIds = getRowIdsHook( |
| 103 | () => props.relationshipId, |
| 104 | rowId, |
| 105 | resolvedRelationships, |
| 106 | ); |
| 107 | const content = () => { |
| 108 | const Row = props.rowComponent ?? RowView; |
| 109 | const [_relationship, store, localTableId] = getRelationshipsStoreTableIds( |
| 110 | getValue(resolvedRelationships), |
| 111 | props.relationshipId, |
| 112 | ); |
| 113 | return wrap( |
| 114 | arrayMap(getValue(rowIds) as Ids, (localRowId) => ( |
| 115 | <Row |
| 116 | {...getProps(props.getRowComponentProps, localRowId)} |
| 117 | tableId={localTableId as Id} |
| 118 | rowId={localRowId} |
| 119 | store={store} |
| 120 | debugIds={props.debugIds} |
| 121 | /> |
| 122 | )), |
| 123 | props.separator, |
| 124 | props.debugIds, |
| 125 | getValue(rowId), |
| 126 | ); |
| 127 | }; |
| 128 | return <>{content()}</>; |
| 129 | }; |
| 130 | |
| 131 | export const getUseCheckpointView = |
| 132 | (getCheckpoints: (checkpointIds: CheckpointIds) => Ids) => |
no test coverage detected
searching dependent graphs…