Phase 3 - Bidirectional Sync: - Add loadFromIntent and loadFromConfig to canvas store - Create useIntentParser hook for parsing Claude messages - Create ConfigImporter component (file upload, paste JSON, load study) - Add import/clear buttons to CanvasView header Phase 4 - Templates & Polish: - Create template library with 5 presets: - Mass Minimization (single-objective) - Multi-Objective Pareto (NSGA-II) - Turbo Mode (with MLP surrogate) - Mirror Zernike (optical optimization) - Frequency Optimization (modal) - Create TemplateSelector component with category filters - Enhanced BaseNode with animations, glow effects, status indicators - Add colorBg to all node types for visual distinction - Add notification toast system - Update all exports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
648 B
TypeScript
18 lines
648 B
TypeScript
import { memo } from 'react';
|
|
import { NodeProps } from 'reactflow';
|
|
import { BaseNode } from './BaseNode';
|
|
import { SurrogateNodeData } from '../../../lib/canvas/schema';
|
|
|
|
function SurrogateNodeComponent(props: NodeProps<SurrogateNodeData>) {
|
|
const { data } = props;
|
|
return (
|
|
<BaseNode {...props} icon={<span>🚀</span>} color="text-pink-600" colorBg="bg-pink-50" outputs={0}>
|
|
<div>{data.enabled ? 'Enabled' : 'Disabled'}</div>
|
|
{data.enabled && data.modelType && (
|
|
<div className="text-xs text-gray-400">{data.modelType}</div>
|
|
)}
|
|
</BaseNode>
|
|
);
|
|
}
|
|
export const SurrogateNode = memo(SurrogateNodeComponent);
|