### What problem does this PR solve? feat: Display input parameters on operator nodes #3240 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import LLMLabel from '@/components/llm-select/llm-label';
|
|
import classNames from 'classnames';
|
|
import { get } from 'lodash';
|
|
import { Handle, NodeProps, Position } from 'reactflow';
|
|
import { NodeData } from '../../interface';
|
|
import { LeftHandleStyle, RightHandleStyle } from './handle-icon';
|
|
import styles from './index.less';
|
|
import NodeHeader from './node-header';
|
|
|
|
export function RewriteNode({
|
|
id,
|
|
data,
|
|
isConnectable = true,
|
|
selected,
|
|
}: NodeProps<NodeData>) {
|
|
return (
|
|
<section
|
|
className={classNames(styles.logicNode, {
|
|
[styles.selectedNode]: selected,
|
|
})}
|
|
>
|
|
<Handle
|
|
id="c"
|
|
type="source"
|
|
position={Position.Left}
|
|
isConnectable={isConnectable}
|
|
className={styles.handle}
|
|
style={LeftHandleStyle}
|
|
></Handle>
|
|
<Handle
|
|
type="source"
|
|
position={Position.Right}
|
|
isConnectable={isConnectable}
|
|
className={styles.handle}
|
|
style={RightHandleStyle}
|
|
id="b"
|
|
></Handle>
|
|
|
|
<NodeHeader
|
|
id={id}
|
|
name={data.name}
|
|
label={data.label}
|
|
className={styles.nodeHeader}
|
|
></NodeHeader>
|
|
|
|
<div className={styles.nodeText}>
|
|
<LLMLabel value={get(data, 'form.llm_id')}></LLMLabel>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|