23 lines
790 B
TypeScript
23 lines
790 B
TypeScript
"use client";
|
|
|
|
import { type NodeProps } from "@xyflow/react";
|
|
import { CalculatorIcon } from "lucide-react";
|
|
import { NodeShell } from "./NodeShell";
|
|
|
|
export function MathNode({ data }: NodeProps) {
|
|
const d = data as { operator?: string };
|
|
const op = d.operator ?? "+";
|
|
|
|
return (
|
|
<NodeShell
|
|
nodeType="math"
|
|
className="bg-violet-950/80 border border-violet-500/50 rounded-lg shadow-md min-w-32"
|
|
>
|
|
<div className="flex items-center gap-2 px-3 py-2 border-b border-violet-500/30">
|
|
<CalculatorIcon className="size-4 text-violet-400 shrink-0" />
|
|
<span className="text-sm font-medium text-violet-200 flex-1">Math</span>
|
|
</div>
|
|
<div className="px-3 py-2 text-center text-lg font-mono text-violet-300">{op}</div>
|
|
</NodeShell>
|
|
);
|
|
}
|