import { useState } from 'react'; import { AtomizerCanvas } from '../components/canvas/AtomizerCanvas'; import { TemplateSelector } from '../components/canvas/panels/TemplateSelector'; import { ConfigImporter } from '../components/canvas/panels/ConfigImporter'; import { useCanvasStore } from '../hooks/useCanvasStore'; import { CanvasTemplate } from '../lib/canvas/templates'; export function CanvasView() { const [showTemplates, setShowTemplates] = useState(false); const [showImporter, setShowImporter] = useState(false); const [notification, setNotification] = useState(null); const { nodes, clear } = useCanvasStore(); const handleTemplateSelect = (template: CanvasTemplate) => { showNotification(`Loaded template: ${template.name}`); }; const handleImport = (source: string) => { showNotification(`Imported from ${source}`); }; const handleClear = () => { if (nodes.length === 0 || window.confirm('Clear all nodes from the canvas?')) { clear(); showNotification('Canvas cleared'); } }; const showNotification = (message: string) => { setNotification(message); setTimeout(() => setNotification(null), 3000); }; return (
{/* Header with actions */}

Optimization Canvas

Drag components from the palette to build your optimization workflow

{/* Action Buttons */}
{/* Main Canvas */}
{/* Template Selector Modal */} setShowTemplates(false)} onSelect={handleTemplateSelect} /> {/* Config Importer Modal */} setShowImporter(false)} onImport={handleImport} /> {/* Notification Toast */} {notification && (
{notification}
)}
); } export default CanvasView;