### What problem does this PR solve? feat: build react flow nodes and edges from mock data #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
25 lines
532 B
TypeScript
25 lines
532 B
TypeScript
import { Handle, NodeProps, Position } from 'reactflow';
|
|
|
|
import styles from './index.less';
|
|
|
|
export function TextUpdaterNode({
|
|
data,
|
|
isConnectable = true,
|
|
}: NodeProps<{ label: string }>) {
|
|
return (
|
|
<div className={styles.textUpdaterNode}>
|
|
<Handle
|
|
type="target"
|
|
position={Position.Left}
|
|
isConnectable={isConnectable}
|
|
/>
|
|
<Handle
|
|
type="source"
|
|
position={Position.Right}
|
|
isConnectable={isConnectable}
|
|
/>
|
|
<div>{data.label}</div>
|
|
</div>
|
|
);
|
|
}
|