mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 22:09:44 +00:00
feat: refactor NodeParamHandler component
This commit is contained in:
@@ -28,23 +28,25 @@ interface NodeParamHandlerProps {
|
||||
index: number; // index of array
|
||||
}
|
||||
|
||||
const renderLabelWithTooltip = (data: IFlowNodeParameter) => (
|
||||
<div>
|
||||
{data.label}:<RequiredIcon optional={data.optional} />
|
||||
{data.description && (
|
||||
<Tooltip title={data.description}>
|
||||
<InfoCircleOutlined className="ml-2 cursor-pointer" />
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
// render node parameters item
|
||||
const NodeParamHandler: React.FC<NodeParamHandlerProps> = ({ node, data, label, index }) => {
|
||||
function onChange(value: any) {
|
||||
data.value = value;
|
||||
}
|
||||
|
||||
function renderLabelWithTooltip(data: IFlowNodeParameter) {
|
||||
return (
|
||||
<div>
|
||||
{data.label}:<RequiredIcon optional={data.optional} />
|
||||
{data.description && (
|
||||
<Tooltip title={data.description}>
|
||||
<InfoCircleOutlined className="ml-2 cursor-pointer" />
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// render node parameters based on AWEL1.0
|
||||
function renderNodeWithoutUiParam(data: IFlowNodeParameter) {
|
||||
let defaultValue = data.value ?? data.default;
|
||||
|
Reference in New Issue
Block a user