From 861ed9e9804a45b57453c933027b47f877eb5d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A8=E6=AC=A3?= Date: Tue, 20 Aug 2024 08:54:53 +0800 Subject: [PATCH] feat: refactor NodeParamHandler component --- web/components/flow/node-param-handler.tsx | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/web/components/flow/node-param-handler.tsx b/web/components/flow/node-param-handler.tsx index 540a74c86..ab76b46a1 100644 --- a/web/components/flow/node-param-handler.tsx +++ b/web/components/flow/node-param-handler.tsx @@ -28,23 +28,25 @@ interface NodeParamHandlerProps { index: number; // index of array } -const renderLabelWithTooltip = (data: IFlowNodeParameter) => ( -
- {data.label}: - {data.description && ( - - - - )} -
-); - // render node parameters item const NodeParamHandler: React.FC = ({ node, data, label, index }) => { function onChange(value: any) { data.value = value; } + function renderLabelWithTooltip(data: IFlowNodeParameter) { + return ( +
+ {data.label}: + {data.description && ( + + + + )} +
+ ); + } + // render node parameters based on AWEL1.0 function renderNodeWithoutUiParam(data: IFlowNodeParameter) { let defaultValue = data.value ?? data.default;