mirror of https://github.com/ANL-CEEESA/RELOG.git
parent
7df33d20cf
commit
5a3c3564b5
@ -0,0 +1,22 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Position, NodeProps, Handle } from '@xyflow/react';
|
||||||
|
|
||||||
|
export interface CustomNodeData {
|
||||||
|
label: string;
|
||||||
|
type: 'plant' | 'product';
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function CustomNode({ data }: NodeProps<any>) {
|
||||||
|
const nodeStyle =
|
||||||
|
data.type === 'plant'
|
||||||
|
? { background: '#b0e0e6', padding: 10, borderRadius: 5 }
|
||||||
|
: { background: '#ffd700', padding: 10, borderRadius: 5 };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={nodeStyle}>
|
||||||
|
<Handle type="target" position={Position.Left} style={{ background: '#555' }} />
|
||||||
|
<div>{data.label}</div>
|
||||||
|
<Handle type="source" position={Position.Right} style={{ background: '#555' }} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
Loading…
Reference in new issue