2024-06-05 10:46:06 +08:00
|
|
|
import classNames from 'classnames';
|
2024-04-28 19:03:54 +08:00
|
|
|
import { Handle, NodeProps, Position } from 'reactflow';
|
|
|
|
|
|
|
|
|
|
import styles from './index.less';
|
|
|
|
|
|
|
|
|
|
export function TextUpdaterNode({
|
|
|
|
|
data,
|
|
|
|
|
isConnectable = true,
|
2024-06-05 10:46:06 +08:00
|
|
|
selected,
|
2024-05-27 08:21:30 +08:00
|
|
|
}: NodeProps<{ label: string }>) {
|
2024-04-28 19:03:54 +08:00
|
|
|
return (
|
2024-06-05 10:46:06 +08:00
|
|
|
<div
|
|
|
|
|
className={classNames(styles.textUpdaterNode, {
|
|
|
|
|
[styles.selectedNode]: selected,
|
|
|
|
|
})}
|
|
|
|
|
>
|
2024-04-28 19:03:54 +08:00
|
|
|
<Handle
|
|
|
|
|
type="target"
|
2024-05-27 08:21:30 +08:00
|
|
|
position={Position.Left}
|
2024-04-28 19:03:54 +08:00
|
|
|
isConnectable={isConnectable}
|
2024-06-05 10:46:06 +08:00
|
|
|
className={styles.handle}
|
|
|
|
|
>
|
|
|
|
|
{/* <PlusCircleOutlined style={{ fontSize: 10 }} /> */}
|
|
|
|
|
</Handle>
|
2024-04-28 19:03:54 +08:00
|
|
|
<Handle
|
|
|
|
|
type="source"
|
2024-05-27 08:21:30 +08:00
|
|
|
position={Position.Right}
|
2024-04-28 19:03:54 +08:00
|
|
|
isConnectable={isConnectable}
|
2024-06-05 10:46:06 +08:00
|
|
|
className={styles.handle}
|
|
|
|
|
>
|
|
|
|
|
{/* <PlusCircleOutlined style={{ fontSize: 10 }} /> */}
|
|
|
|
|
</Handle>
|
2024-05-27 08:21:30 +08:00
|
|
|
<div>{data.label}</div>
|
2024-04-28 19:03:54 +08:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|