import { AlertCircle, Braces, Plus, Trash2, X } from 'lucide-react' import { CATEGORY_LABELS } from '../lib/catalog' import type { BehaviorNode, BehaviorTreeDocument, ValidationIssue } from '../types' interface InspectorProps { document: BehaviorTreeDocument selectedNode: BehaviorNode | null issues: ValidationIssue[] onUpdateDocument: (patch: Partial>) => void onUpdateNode: (nodeId: string, data: Partial) => void onDeleteNode: (nodeId: string) => void onSelectIssue: (nodeId: string) => void } export function Inspector({ document, selectedNode, issues, onUpdateDocument, onUpdateNode, onDeleteNode, onSelectIssue }: InspectorProps) { const updatePort = (oldKey: string, key: string, value: string) => { if (!selectedNode) return const ports = { ...selectedNode.data.ports } if (oldKey !== key) delete ports[oldKey] ports[key] = value onUpdateNode(selectedNode.id, { ports }) } const removePort = (key: string) => { if (!selectedNode) return const ports = { ...selectedNode.data.ports } delete ports[key] onUpdateNode(selectedNode.id, { ports }) } const addPort = () => { if (!selectedNode) return let key = 'port' let index = 1 while (key in selectedNode.data.ports) key = `port_${index++}` onUpdateNode(selectedNode.id, { ports: { ...selectedNode.data.ports, [key]: '' } }) } return (