- NodeShell component wraps all nodes with handle rendering + px-8 content padding
- Handles positioned at node edges with labels outside (no overlap with content)
- Labels: 9px mono font, full opacity, color-matched to socket type
- Removed old TypedHandle + NodeHandles (replaced by NodeShell internals)
- All 18 node components updated to use NodeShell
- Format node dynamically generates handles from template {0}, {1}, etc.
20 lines
758 B
TypeScript
20 lines
758 B
TypeScript
"use client";
|
|
|
|
import { type NodeProps } from "@xyflow/react";
|
|
import { BinaryIcon } from "lucide-react";
|
|
import { NodeShell } from "./NodeShell";
|
|
|
|
export function LogicNode({ data }: NodeProps) {
|
|
const d = data as { operator?: string };
|
|
const op = d.operator ?? "AND";
|
|
|
|
return (
|
|
<NodeShell nodeType="logic" className="bg-lime-950/80 border border-lime-500/50 rounded-lg shadow-md min-w-32">
|
|
<div className="flex items-center gap-2 px-3 py-2 border-b border-lime-500/30">
|
|
<BinaryIcon className="size-4 text-lime-400 shrink-0" />
|
|
<span className="text-sm font-medium text-lime-200 flex-1">Logic</span>
|
|
</div>
|
|
<div className="px-3 py-2 text-center text-sm font-mono text-lime-300">{op}</div>
|
|
</NodeShell>
|
|
);
|
|
}
|