import type { FC } from 'react' import { memo, useEffect, } from 'react' import { Background, useNodesInitialized, useViewport, } from 'reactflow' import { useNodeIterationInteractions } from './use-interactions' import type { IterationNodeType } from './types' import AddBlock from './add-block' import cn from '@/utils/classnames' import type { NodeProps } from '@/app/components/workflow/types' const Node: FC> = ({ id, data, }) => { const { zoom } = useViewport() const nodesInitialized = useNodesInitialized() const { handleNodeIterationRerender } = useNodeIterationInteractions() useEffect(() => { if (nodesInitialized) handleNodeIterationRerender(id) }, [nodesInitialized, id, handleNodeIterationRerender]) return (
) } export default memo(Node)