diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 29040fd0d..5aff862b5 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -1,5 +1,5 @@ import _ from "lodash"; -import { Connection, ReactFlowInstance } from "reactflow"; +import { Connection, Edge, ReactFlowInstance } from "reactflow"; import { APITemplateType } from "../types/api"; import { FlowType, NodeType } from "../types/flow"; import { cleanEdgesType } from "../types/utils/reactflowUtils"; @@ -240,3 +240,12 @@ export function handleKeyDown(e: React.KeyboardEvent, inputVal e.stopPropagation(); } }; + +export function getConnectedNodes( + edge: Edge, + nodes: Array +): Array { + const sourceId = edge.source; + const targetId = edge.target; + return nodes.filter((node) => node.id === targetId || node.id === sourceId); +} diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index dd34b5001..42fbe8773 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -65,7 +65,6 @@ import { XCircle, Zap, } from "lucide-react"; -import { Edge, Node } from "reactflow"; import { AirbyteIcon } from "../icons/Airbyte"; import { AnthropicIcon } from "../icons/Anthropic"; import { BingIcon } from "../icons/Bing"; @@ -277,8 +276,3 @@ export const nodeIconsLucide = { MessageSquare, MoreHorizontal, }; -export function getConnectedNodes(edge: Edge, nodes: Array): Array { - const sourceId = edge.source; - const targetId = edge.target; - return nodes.filter((node) => node.id === targetId || node.id === sourceId); -}