'use client';
import { useLayerStore } from '@/store';
import { Eye, EyeOff, Trash2, Copy } from 'lucide-react';
import { cn } from '@/lib/utils';
import {
deleteLayerWithHistory,
updateLayerWithHistory,
duplicateLayerWithHistory,
} from '@/lib/layer-operations';
export function LayersPanel() {
const { layers, activeLayerId, setActiveLayer } = useLayerStore();
// Sort layers by order (highest first)
const sortedLayers = [...layers].sort((a, b) => b.order - a.order);
return (
Layers
{sortedLayers.length === 0 ? (
) : (
sortedLayers.map((layer) => (
setActiveLayer(layer.id)}
>
{layer.name}
{layer.width} × {layer.height}
{Math.round(layer.opacity * 100)}%
))
)}
);
}