"use client"; import { Handle, Position, type Node, type NodeProps } from "@xyflow/react"; import { TriangleAlertIcon } from "lucide-react"; import React from "react"; import type { TreeTech } from "./types"; export type TechNodeData = { tech: TreeTech; categoryName: string | null; refLabel: string; hasWarning: boolean; connectable: boolean; }; export type TechNodeModel = Node; const STATUS_LABELS: Record = { in_progress: { label: "In Progress", className: "text-blue-400" }, ready_for_review: { label: "Ready for Review", className: "text-amber-400" }, approved: { label: "Approved", className: "text-emerald-400" }, rejected: { label: "Rejected", className: "text-red-400" }, revision_requested: { label: "Revision Requested", className: "text-orange-400" }, }; function CornerBrackets() { const base = "pointer-events-none absolute size-2 border-white/25"; return (
); } /** * Technology card node: tactical dossier styling (squared corners, * classification strip, corner brackets, mono readouts). */ export function TechNodeCard({ data, selected }: NodeProps) { const { tech, categoryName, refLabel, hasWarning, connectable } = data; const status = STATUS_LABELS[tech.approvalStatus] ?? { label: tech.approvalStatus, className: "text-white/60", }; return (
{/* Clipped card surface (the handles live outside this box) */}
{/* Classification strip */}
TECH // {categoryName ?? "UNFILED"} {refLabel}
{/* Body */}
{tech.name} {hasWarning ? ( ) : null}
{tech.type} {status.label}
{/* Footer readout */}
{tech.type === "asset" ? "UNLOCK" : "UPGRADE"} {tech.categoryId ? "BAND" : "ZONE"}
); }