Skip to content

Commit

Permalink
feat: refactor NodeParamHandler component
Browse files Browse the repository at this point in the history
  • Loading branch information
谨欣 committed Aug 20, 2024
1 parent 09b9523 commit 861ed9e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions web/components/flow/node-param-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 861ed9e

Please sign in to comment.