import { chakra } from '@chakra-ui/system' import { useTypebot } from 'contexts/TypebotContext' import React, { useMemo } from 'react' import { DrawingEdge } from './DrawingEdge' import { Edge, StepWithTarget } from './Edge' export const Edges = () => { const { typebot } = useTypebot() const { blocks, startBlock } = typebot ?? {} const stepsWithTarget: StepWithTarget[] = useMemo(() => { if (!startBlock) return [] return [ ...(startBlock.steps.filter((s) => s.target) as StepWithTarget[]), ...((blocks ?? []) .flatMap((b) => b.steps) .filter((s) => s.target) as StepWithTarget[]), ] }, [blocks, startBlock]) return ( {stepsWithTarget.map((step) => ( ))} ) }