20 lines
618 B
TypeScript
20 lines
618 B
TypeScript
import { memo, FC } from 'react';
|
|
import { Handle, Position, NodeProps } from 'reactflow';
|
|
|
|
import { NodeResizer, NodeResizeControl } from '@reactflow/node-resizer';
|
|
import '@reactflow/node-resizer/dist/style.css';
|
|
|
|
const CustomNode: FC<NodeProps> = ({ id, data }) => {
|
|
return (
|
|
<>
|
|
<NodeResizeControl color="red" position="top" />
|
|
<NodeResizeControl color="red" position="bottom" />
|
|
<Handle type="target" position={Position.Left} />
|
|
<div style={{ padding: 10 }}>{data.label}</div>
|
|
<Handle type="source" position={Position.Right} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default memo(CustomNode);
|