import { memo } from "react"; import { theme } from "antd"; import { type WorkflowNode } from "@/domain/workflow"; import AddNode from "./AddNode"; import WorkflowElement from "../WorkflowElement"; import { type SharedNodeProps } from "./_SharedNode"; export type BrandNodeProps = SharedNodeProps; const ExecuteResultBranchNode = ({ node, disabled }: BrandNodeProps) => { const { token: themeToken } = theme.useToken(); const renderBranch = (node: WorkflowNode, branchNodeId?: string, branchIndex?: number) => { const elements: JSX.Element[] = []; let current = node as typeof node | undefined; while (current) { elements.push(); current = current.next; } return elements; }; return ( <>
{node.branches?.map((branch, index) => (
{index == 0 && ( <>
)} {node.branches && index == node.branches.length - 1 && ( <>
)}
{renderBranch(branch, node.id, index)}
))}
); }; export default memo(ExecuteResultBranchNode);