/** * CanvasToolbar — Shape creation tools, selection, delete, color picker. */ export type CanvasTool = 'select' | 'rect' | 'ellipse' | 'line' | 'text' const PRESET_COLORS = [ '#6366f1', // indigo '#ef4444', // red '#22c55e', // green '#3b82f6', // blue '#f59e0b', // amber '#8b5cf6', // violet '#ec4899', // pink '#14b8a6', // teal '#64748b', // slate '#000000', // black ] interface CanvasToolbarProps { activeTool: CanvasTool activeColor: string hasSelection: boolean onToolChange: (tool: CanvasTool) => void onColorChange: (color: string) => void onDelete: () => void onUndo: () => void onRedo: () => void } const tools: { id: CanvasTool; label: string; icon: React.ReactNode }[] = [ { id: 'select', label: 'Select', icon: ( ), }, { id: 'rect', label: 'Rectangle', icon: ( ), }, { id: 'ellipse', label: 'Ellipse', icon: ( ), }, { id: 'line', label: 'Line', icon: ( ), }, { id: 'text', label: 'Text', icon: ( ), }, ] export function CanvasToolbar({ activeTool, activeColor, hasSelection, onToolChange, onColorChange, onDelete, onUndo, onRedo, }: CanvasToolbarProps) { return (
{/* Shape tools */}
{tools.map((tool) => ( ))}
{/* Color picker */}
{PRESET_COLORS.map((color) => (
{/* Actions */}
) }