import { Handle, Position } from '@reactflow/core'; import { type CSSProperties, type FC, memo } from 'react'; import { CiSquareRemove } from 'react-icons/ci'; import { IoGitNetworkSharp } from 'react-icons/io5'; import { VscDebugStart } from 'react-icons/vsc'; import MiniButton from '@/components/ui/MiniButton.tsx'; import { useSynthesis } from '@/pages/OssPage/SynthesisContext.tsx'; const sourceHandleStyleA: CSSProperties = { left: 50 }; const sourceHandleStyleB: CSSProperties = { right: 50, left: 'auto' }; interface OperationNodeProps { id: string; data: { label: string; onDelete: (nodeId: string) => void; }; xPos: number; yPos: number; } const OperationNode: FC = ({ id, data, xPos, yPos }) => { const controller = useSynthesis(); const { label, onDelete } = data; const handleDelete = () => { onDelete(id); }; const handleSubstitution = () => { controller.selectNode(id); controller.showSynthesis(); }; const handleSynthesis = () => { controller.singleSynthesis(id); }; return ( <>
} title='Удалить' onClick={handleDelete} color={'red'} />
Тип: Отождествление
Схема: } title='Синтез' onClick={() => handleSynthesis()} /> } title='Отождествления' onClick={() => handleSubstitution()} />
); }; export default memo(OperationNode);