mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
![]() |
import {memo, type FC, type CSSProperties} from 'react';
|
|||
|
import {Handle, Position, type NodeProps} from '@reactflow/core';
|
|||
|
|
|||
|
const sourceHandleStyleA: CSSProperties = {left: 50};
|
|||
|
const sourceHandleStyleB: CSSProperties = {
|
|||
|
right: 50,
|
|||
|
left: 'auto',
|
|||
|
};
|
|||
|
|
|||
|
const OperationNode: FC<NodeProps> = ({data, xPos, yPos}) => {
|
|||
|
return (
|
|||
|
<>
|
|||
|
<Handle type="target" position={Position.Bottom}/>
|
|||
|
<div>
|
|||
|
<div>
|
|||
|
Тип: <strong>{data.label}</strong>
|
|||
|
</div>
|
|||
|
<div>
|
|||
|
Схема:{' '}
|
|||
|
<strong>
|
|||
|
{xPos.toFixed(2)},{yPos.toFixed(2)}
|
|||
|
</strong>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<Handle
|
|||
|
type="source"
|
|||
|
position={Position.Top}
|
|||
|
id="a"
|
|||
|
style={sourceHandleStyleA}
|
|||
|
/>
|
|||
|
<Handle
|
|||
|
type="source"
|
|||
|
position={Position.Top}
|
|||
|
id="b"
|
|||
|
style={sourceHandleStyleB}
|
|||
|
/>
|
|||
|
</>
|
|||
|
);
|
|||
|
};
|
|||
|
|
|||
|
export default memo(OperationNode);
|