/* 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.userRole === 'owner' && (
👑 Owner
)}
{collection.isPublic && (
🌍 Public
)}
);
}
if (!thumbnails || thumbnails.length === 0) {
return (
{collection.userRole === 'owner' && (
👑 Owner
)}
{collection.isPublic && (
🌍 Public
)}
);
}
const mainCard = thumbnails[0];
const gridCards = thumbnails.slice(1, 5);
return (
{Array.from({ length: 4 }).map((_, index) => {
const card = gridCards[index];
return (
);
})}
{collection.userRole === 'owner' && (
👑 Owner
)}
{collection.isPublic && (
🌍 Public
)}
);
}