'use client'; import { useEffect } from 'react'; import { useCanvasStore, useLayerStore } from '@/store'; import { CanvasWrapper } from '@/components/canvas/canvas-wrapper'; import { LayersPanel } from '@/components/layers/layers-panel'; import { Plus, ZoomIn, ZoomOut, Maximize } from 'lucide-react'; export function EditorLayout() { const { zoom, zoomIn, zoomOut, zoomToFit, setDimensions } = useCanvasStore(); const { createLayer, layers } = useLayerStore(); // Initialize with a default layer useEffect(() => { if (layers.length === 0) { createLayer({ name: 'Background', width: 800, height: 600, fillColor: '#ffffff', }); } }, []); const handleNewLayer = () => { createLayer({ name: `Layer ${layers.length + 1}`, width: 800, height: 600, }); }; const handleZoomToFit = () => { // Approximate viewport size (accounting for panels) const viewportWidth = window.innerWidth - 320; // Subtract sidebar width const viewportHeight = window.innerHeight - 60; // Subtract toolbar height zoomToFit(viewportWidth, viewportHeight); }; return (
{/* Toolbar */}

Paint UI

{/* Zoom controls */}
{Math.round(zoom * 100)}%
{/* Main content */}
{/* Canvas area */}
{/* Right sidebar */}
); }