'use client'; import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; import { DEFAULT_ALBUM_SORT } from '@/lib/albumSort'; import { IconCamera, IconGripVertical, IconImage, IconLock, IconPencil, IconTrash } from '../Icons'; import { SORT_LABELS } from './sortOptions'; import type { AlbumEntry } from './types'; export function SortableAlbumCard({ album, index, name, count, thumbnailId, onRemove, onEdit, highlighted, }: { album: AlbumEntry; index: number; name: string; count: number; thumbnailId: string | null; onRemove: () => void; onEdit: () => void; highlighted?: boolean; }) { const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: `album-${album.id}-${index}`, }); const style = { transform: CSS.Transform.toString(transform), transition, opacity: isDragging ? 0.5 : 1, zIndex: isDragging ? 10 : undefined, }; return (