diff --git a/src/app/components/InfiniteScrollCards.js b/src/app/components/InfiniteScrollCards.js index 483dfb50fb424639255fefe55f219ff4204c1f2e..597471a05fba3b00b5a72c0c2313eb6b105263c2 100644 --- a/src/app/components/InfiniteScrollCards.js +++ b/src/app/components/InfiniteScrollCards.js @@ -81,44 +81,45 @@ export default function InfiniteScrollCards({ setMecLoading, data, searchClass, return ( <div className="justify-center ml-8"> {data?.map((item) => ( - <div - key={item.id} - className="bg-white-HC-dark outline outline-1 outline-ice-HC-white mb-10 pt-6 px-4 rounded-2xl relative" - > - {/* Cabeçalho com título, autor e botões */} - <div className="flex justify-between items-start"> - {/* Título e autor */} - <div className="flex flex-col"> - <p className="text-2xl font-bold mb-1 text-darkGray-HC-white-underline hover:underline"> - <Link href={`/colecao/${item.id}`}>{item.name}</Link> - </p> - <p className="ml-1 text-darkGray-HC-white"> - por{" "} - <Link - className="text-darkGray-HC-white-underline hover:underline" - href={`/perfil/${item.owner.id}`} - > - {item.owner.name} - </Link> - </p> + item.collection_items?.length > 0 && ( + <div + key={item.id} + className="bg-white-HC-dark outline outline-1 outline-ice-HC-white mb-10 pt-6 px-4 rounded-2xl relative" + > + {/* Cabeçalho com título, autor e botões */} + <div className="flex justify-between items-start"> + {/* Título e autor */} + <div className="flex flex-col"> + <p className="text-2xl font-bold mb-1 text-darkGray-HC-white-underline hover:underline"> + <Link href={`/colecao/${item.id}`}>{item.name}</Link> + </p> + <p className="ml-1 text-darkGray-HC-white"> + por{" "} + <Link + className="text-darkGray-HC-white-underline hover:underline" + href={`/perfil/${item.owner.id}`} + > + {item.owner.name} + </Link> + </p> + </div> + + {/* Botões */} + <div className="flex flex-row gap-2 justify-end"> + <DownloadButton id={item.id} objects={item.collection_items} /> + <ShareButton type="colecao" id={item.id} /> + </div> </div> - - {/* Botões */} - <div className="flex flex-row gap-2 justify-end"> - <DownloadButton id={item.id} objects={item.collection_items} /> - <ShareButton type="colecao" id={item.id} /> + + {/* Cartões da coleção abaixo do cabeçalho */} + <div className="mt-4"> + <GroupCardsCollections + cardsPerRow={cardsPerRow} + data={item.collection_items} + collectionId={item.id} + /> </div> - </div> - - {/* Cartões da coleção abaixo do cabeçalho */} - <div className="mt-4"> - <GroupCardsCollections - cardsPerRow={cardsPerRow} - data={item.collection_items} - collectionId={item.id} - /> - </div> - </div> + </div>) ))} </div> );