import { memo, type FC, type CSSProperties } from 'react'; import { Handle, Position, type NodeProps } from '@reactflow/core'; import MiniButton from '@/components/ui/MiniButton.tsx'; import { IoGitNetworkSharp } from 'react-icons/io5'; import { useSynthesis } from '@/pages/OssPage/SynthesisContext.tsx'; import { CiSquareRemove } from 'react-icons/ci'; import { VscDebugStart } from "react-icons/vsc"; 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);