- 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.
23 lines
878 B
TypeScript
23 lines
878 B
TypeScript
"use client";
|
|
|
|
import { type NodeProps } from "@xyflow/react";
|
|
import { CheckCircleIcon } from "lucide-react";
|
|
import { NodeShell } from "./NodeShell";
|
|
|
|
export function BooleanNode({ data }: NodeProps) {
|
|
const d = data as { value?: boolean; description?: string };
|
|
|
|
return (
|
|
<NodeShell nodeType="boolean" className="bg-emerald-950/80 border border-emerald-500/50 rounded-lg shadow-md min-w-28">
|
|
<div className="flex items-center gap-2 px-3 py-2 border-b border-emerald-500/30">
|
|
<CheckCircleIcon className="size-4 text-emerald-400 shrink-0" />
|
|
<span className="text-sm font-medium text-emerald-200 flex-1 truncate">
|
|
{(d.value ?? false) ? "true" : "false"}
|
|
</span>
|
|
</div>
|
|
<div className="px-3 py-2 text-xs text-emerald-300/80 line-clamp-2">
|
|
{d.description || "Boolean flag"}
|
|
</div>
|
|
</NodeShell>
|
|
);
|
|
}
|