From 38f60933b2f8094501d289b268e8203ba3fc9ff5 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 17 Jun 2024 20:36:50 -0300 Subject: [PATCH] Modularized handle component --- .../handleRenderComponent/index.tsx | 100 +++++++++++ .../components/parameterComponent/index.tsx | 169 +++--------------- 2 files changed, 127 insertions(+), 142 deletions(-) create mode 100644 src/frontend/src/CustomNodes/GenericNode/components/handleRenderComponent/index.tsx diff --git a/src/frontend/src/CustomNodes/GenericNode/components/handleRenderComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/handleRenderComponent/index.tsx new file mode 100644 index 000000000..3307ca03b --- /dev/null +++ b/src/frontend/src/CustomNodes/GenericNode/components/handleRenderComponent/index.tsx @@ -0,0 +1,100 @@ +import { Handle, Position } from "reactflow"; +import ShadTooltip from "../../../../components/shadTooltipComponent"; +import { Button } from "../../../../components/ui/button"; +import { + isValidConnection, + scapedJSONStringfy, +} from "../../../../utils/reactflowUtils"; +import { classNames, cn, groupByFamily } from "../../../../utils/utils"; +import HandleTooltips from "../HandleTooltipComponent"; +import { title } from "process"; + +export default function HandleRenderComponent({ + left, + nodes, + tooltipTitle, + proxy, + id, + title, + edges, + myData, + colors, + setFilterEdge, + showNode, +}) { + return ( + + ); +} diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 8e8657af4..dcf6f53d8 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -49,6 +49,7 @@ import useHandleNodeClass from "../../../hooks/use-handle-node-class"; import useHandleRefreshButtonPress from "../../../hooks/use-handle-refresh-buttons"; import HandleTooltips from "../HandleTooltipComponent"; import OutputComponent from "../OutputComponent"; +import HandleRenderComponent from "../handleRenderComponent"; import OutputModal from "../outputModal"; import { TEXT_FIELD_TYPES } from "./constants"; @@ -268,80 +269,19 @@ export default function ParameterComponent({ left && LANGFLOW_SUPPORTED_TYPES.has(type ?? "") && !optionalHandle ? ( <> ) : ( - + ) ) : (
) : ( - + )}