const splitIndicatorSnapshots = (panesSnapshot: PaneSnapshot[]) => {
const indicatorSnapshots: IndicatorSnapshot[] = [];
const compareSnapshots: IndicatorSnapshot[] = [];
panesSnapshot.forEach((pane) => {
pane.indicators.forEach((indicator) => {
const snapshot = {
...indicator,
paneId: pane.id,
};
if (snapshot.indicatorType === undefined) {
compareSnapshots.push(snapshot);
} else {
indicatorSnapshots.push(snapshot);
}
});
});
return {
indicatorSnapshots,
compareSnapshots,
};
};