{ if (draggingId != null) e.preventDefault(); }}
onDrop={commitDrop}
onDragEnd={onDragEnd}
>
{items.map((c) => {
const customPath = isLandscape ? c.coverLandscapePath : c.coverPortraitPath;
const customZoom = isLandscape ? c.coverLandscapeZoom : c.coverPortraitZoom;
const customOffsetX = isLandscape ? c.coverLandscapeOffsetX : c.coverPortraitOffsetX;
const customOffsetY = isLandscape ? c.coverLandscapeOffsetY : c.coverPortraitOffsetY;
const fallbackThumb = c.cover_thumb ?? c.first_thumb;
const selected = sel.has(c.id);
const anySelected = sel.ids.size > 0;
return (
onDragStart(c.id, e)}
onDragOver={(e) => onDragOverCard(c.id, e)}
onDragEnd={onDragEnd}
className={cn(
"relative group/drag",
draggingId === c.id && "opacity-40",
dropBeforeId === c.id && "ring-2 ring-[var(--color-cyan)] ring-offset-2 ring-offset-[var(--color-bg-0)] rounded-2xl",
selected && "ring-2 ring-[var(--color-cyan)] shadow-[var(--shadow-glow-cyan)] rounded-2xl",
anySelected && !selected && "opacity-70 hover:opacity-100",
)}
>
{
if (anySelected) {
e.preventDefault();
sel.toggle(c.id);
}
}}
className="group glass glass-hover rounded-2xl overflow-hidden block"
>
{customPath ? (
/* eslint-disable-next-line @next/next/no-img-element */
})
) : fallbackThumb ? (
/* eslint-disable-next-line @next/next/no-img-element */

) : (
)}
{c.count} Item{c.count === 1 ? "" : "s"}
{renamingId === c.id ? (
{ e.preventDefault(); e.stopPropagation(); }}
onMouseDown={(e) => e.stopPropagation()}
>
setDraftName(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") { e.preventDefault(); commitRename(c); }
if (e.key === "Escape") { e.preventDefault(); cancelRename(); }
}}
disabled={renamePending}
maxLength={120}
className="flex-1 min-w-0 h-full glass rounded-md px-2 text-sm outline-none focus:border-[var(--color-cyan)]"
/>
) : (
{c.name}
)}
{c.description && (
{c.description}
)}