import { memo } from 'react'; import { NodeProps } from 'reactflow'; import { Cpu, Terminal } from 'lucide-react'; import { BaseNode } from './BaseNode'; import { SolverNodeData, SolverEngine } from '../../../lib/canvas/schema'; // Human-readable engine names const ENGINE_LABELS: Record = { nxnastran: 'NX Nastran', mscnastran: 'MSC Nastran', python: 'Python Script', abaqus: 'Abaqus', ansys: 'ANSYS', }; function SolverNodeComponent(props: NodeProps) { const { data } = props; // Build display string: "Engine - SolutionType" or just one const engineLabel = data.engine ? ENGINE_LABELS[data.engine] : null; const solverTypeLabel = data.solverType || null; let displayText: string; if (engineLabel && solverTypeLabel) { displayText = `${engineLabel} (${solverTypeLabel})`; } else if (engineLabel) { displayText = engineLabel; } else if (solverTypeLabel) { displayText = solverTypeLabel; } else { displayText = 'Configure solver'; } // Use Terminal icon for Python, Cpu for others const icon = data.engine === 'python' ? : ; return ( {displayText} ); } export const SolverNode = memo(SolverNodeComponent);