import { cn } from "@/lib/utils"; import { Position } from "@xyflow/react"; import { COND_H, COND_W, SCOPE_CONFIG, type ScopeKey } from "../constants"; import { RFEdgeHandle } from "./rfEdgeHandle"; /** Width of the left scope-color strip (matches common “start node” accent bars). */ const ACCENT_STRIP_CLASS = "w-2.5"; export function RFConditionNode({ data }: { data: any }) { const condition = data.condition as string; const color = data.color as string | null; const scopes = (data.scopes as string[] | undefined) ?? []; const accent = color ?? undefined; return (
{condition} {scopes.length > 0 && (
{scopes.map((sc) => { const cfg = SCOPE_CONFIG[sc as ScopeKey]; return cfg ? ( {cfg.label} ) : null; })}
)}
); }