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

Function getUseCheckpointView

src/ui-react/common/index.tsx:126–155  ·  view source on GitHub ↗
(getCheckpoints: (checkpointIds: CheckpointIds) => Ids)

Source from the content-addressed store, hash-verified

124
125export const getUseCheckpointView =
126 (getCheckpoints: (checkpointIds: CheckpointIds) => Ids) =>
127 ({
128 checkpoints,
129 checkpointComponent: Checkpoint = CheckpointView,
130 getCheckpointComponentProps,
131 separator,
132 debugIds,
133 }: (
134 BackwardCheckpointsProps | CurrentCheckpointProps | ForwardCheckpointsProps
135 ) & {
136 readonly separator?: ReactElement | string;
137 }): any => {
138 const resolvedCheckpoints = useCheckpointsOrCheckpointsById(checkpoints);
139 return (
140 <Wrap separator={separator}>
141 {arrayMap(
142 getCheckpoints(useCheckpointIds(resolvedCheckpoints)),
143 (checkpointId: Id) => (
144 <Checkpoint
145 key={checkpointId}
146 {...getProps(getCheckpointComponentProps, checkpointId as Id)}
147 checkpoints={resolvedCheckpoints}
148 checkpointId={checkpointId}
149 debugIds={debugIds}
150 />
151 ),
152 )}
153 </Wrap>
154 );
155 };

Calls 5

arrayMapFunction · 0.90
useCheckpointIdsFunction · 0.90
getPropsFunction · 0.90
getCheckpointsFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…