import { useRef } from 'react' import { Save, LayoutDashboard, Download, Palette, Undo2, Redo2, HelpCircle, Table2, FileDown, Upload } from 'lucide-react' import { Button } from '@/components/ui/button' import { Logo } from '@/components/ui/Logo' import { useCanvasStore } from '@/stores/canvasStore' interface ToolbarProps { onSave: () => void onAutoLayout: () => void onExport: () => void onChangeStyle: () => void onUndo: () => void onRedo: () => void onShortcuts: () => void onExportMd: () => void onExportYaml: () => void onImportYaml: (content: string) => void } export function Toolbar({ onSave, onAutoLayout, onExport, onChangeStyle, onUndo, onRedo, onShortcuts, onExportMd, onExportYaml, onImportYaml }: ToolbarProps) { const { hasUnsavedChanges, past, future } = useCanvasStore() const fileInputRef = useRef(null) function handleFileChange(e: React.ChangeEvent) { const file = e.target.files?.[0] if (!file) return const reader = new FileReader() reader.onload = (ev) => { const content = ev.target?.result if (typeof content === 'string') onImportYaml(content) } reader.readAsText(file) e.target.value = '' } return (
) }