(getCheckpoints: (checkpointIds: CheckpointIds) => Ids)
| 130 | |
| 131 | export const getUseCheckpointView = |
| 132 | (getCheckpoints: (checkpointIds: CheckpointIds) => Ids) => |
| 133 | ( |
| 134 | props: ( |
| 135 | | BackwardCheckpointsProps |
| 136 | | CurrentCheckpointProps |
| 137 | | ForwardCheckpointsProps |
| 138 | ) & { |
| 139 | separator?: JSXElement | string; |
| 140 | }, |
| 141 | ): JSXElement => { |
| 142 | const resolvedCheckpoints = useCheckpointsOrCheckpointsById( |
| 143 | () => props.checkpoints, |
| 144 | ); |
| 145 | const checkpointIds = useCheckpointIds(resolvedCheckpoints); |
| 146 | const content = () => { |
| 147 | const Checkpoint = props.checkpointComponent ?? CheckpointView; |
| 148 | return wrap( |
| 149 | arrayMap( |
| 150 | getCheckpoints(getValue(checkpointIds) as CheckpointIds), |
| 151 | (checkpointId: Id) => ( |
| 152 | <Checkpoint |
| 153 | {...getProps( |
| 154 | props.getCheckpointComponentProps, |
| 155 | checkpointId as Id, |
| 156 | )} |
| 157 | checkpoints={getValue(resolvedCheckpoints)} |
| 158 | checkpointId={checkpointId} |
| 159 | debugIds={props.debugIds} |
| 160 | /> |
| 161 | ), |
| 162 | ), |
| 163 | props.separator, |
| 164 | ); |
| 165 | }; |
| 166 | return <>{content()}</>; |
| 167 | }; |
no test coverage detected
searching dependent graphs…