import { memo, useCallback, useState, } from 'react' import { useNodesInteractions } from '../../hooks' import type { BlockEnum, OnSelectBlock, } from '../../types' import BlockSelector from '../../block-selector' import cn from '@/utils/classnames' type InsertBlockProps = { startNodeId: string availableBlocksTypes: BlockEnum[] } const InsertBlock = ({ startNodeId, availableBlocksTypes, }: InsertBlockProps) => { const [open, setOpen] = useState(false) const { handleNodeAdd } = useNodesInteractions() const handleOpenChange = useCallback((v: boolean) => { setOpen(v) }, []) const handleInsert = useCallback((nodeType, toolDefaultValue) => { handleNodeAdd( { nodeType, toolDefaultValue, }, { nextNodeId: startNodeId, nextNodeTargetHandle: 'target', }, ) }, [startNodeId, handleNodeAdd]) return (
'hover:scale-125 transition-all'} />
) } export default memo(InsertBlock)