28 lines
626 B
TypeScript
28 lines
626 B
TypeScript
"use client";
|
|
|
|
import { GitBranch } from "lucide-react";
|
|
import { BaseNode } from "./BaseNode";
|
|
import type { ConditionData } from "@/lib/types/campaign";
|
|
|
|
interface Props {
|
|
id: string;
|
|
data: { label: string; nodeData: ConditionData };
|
|
}
|
|
|
|
export function ConditionNode({ id, data }: Props) {
|
|
return (
|
|
<BaseNode
|
|
id={id}
|
|
label={data.label}
|
|
type="condition"
|
|
icon={<GitBranch className="w-4 h-4" />}
|
|
color="#a855f7"
|
|
hasOutput={false}
|
|
hasTrueOutput
|
|
hasFalseOutput
|
|
>
|
|
{data.nodeData.metric} {data.nodeData.operator} {data.nodeData.threshold}
|
|
</BaseNode>
|
|
);
|
|
}
|