import { mergeSubblockStateWithValues } from '@sim/workflow-persistence/subblocks' import type { BlockState } from '@/stores/workflows/workflow/types' interface GetWorkflowSearchBlocksOptions { blocks: Record isSnapshotView?: boolean subblockValues?: Record> } export function getWorkflowSearchBlocks({ blocks, isSnapshotView, subblockValues, }: GetWorkflowSearchBlocksOptions): Record { if (isSnapshotView || !subblockValues) return blocks return mergeSubblockStateWithValues(blocks, subblockValues) }