import type { FC } from 'react' import type { LoopNodeType } from './types' import type { NodeProps } from '@/app/components/workflow/types' import { memo, useEffect, } from 'react' import { Background, useNodesInitialized, useViewport, } from 'reactflow' import { cn } from '@/utils/classnames' import { LoopStartNodeDumb } from '../loop-start' import AddBlock from './add-block' import { useNodeLoopInteractions } from './use-interactions' const Node: FC> = ({ id, data, }) => { const { zoom } = useViewport() const nodesInitialized = useNodesInitialized() const { handleNodeLoopRerender } = useNodeLoopInteractions() useEffect(() => { if (nodesInitialized) handleNodeLoopRerender(id) }, [nodesInitialized, id, handleNodeLoopRerender]) return (
{ data._isCandidate && ( ) } { data._children!.length === 1 && ( ) }
) } export default memo(Node)