/* eslint-disable @next/next/no-img-element -- Collection thumbnail images; next/image migration is out of scope. */ export default function CollectionsThumbnail({ collection }) { const { thumbnails = [], image } = collection; if (image) { return (
{collection.name}
{collection.userRole === 'owner' && ( 👑 Owner )} {collection.isPublic && ( 🌍 Public )}
); } if (!thumbnails || thumbnails.length === 0) { return (
😢

No cards yet

{collection.userRole === 'owner' && ( 👑 Owner )} {collection.isPublic && ( 🌍 Public )}
); } const mainCard = thumbnails[0]; const gridCards = thumbnails.slice(1, 5); return (
{mainCard ? (
{mainCard.name}
) : (
)}
{Array.from({ length: 4 }).map((_, index) => { const card = gridCards[index]; return (
{card ? (
{card.name}
) : (
)}
); })}
{collection.userRole === 'owner' && ( 👑 Owner )} {collection.isPublic && ( 🌍 Public )}
); }