From 6c6b6f418aa737d1c9388b8ac287688416672b83 Mon Sep 17 00:00:00 2001 From: pollutri Date: Fri, 15 May 2026 18:08:32 +0200 Subject: [PATCH] fix card counter, hidden card type in fontend --- components/PublicGrid.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/components/PublicGrid.tsx b/components/PublicGrid.tsx index 6d2a7ca..4f0afb9 100644 --- a/components/PublicGrid.tsx +++ b/components/PublicGrid.tsx @@ -453,7 +453,8 @@ export default function PublicGrid({ cards, maxCols = 5 }: { cards: Card[], maxC <>
{cards.map((card) => { - const galleryCount = (card.extraMedia?.length || 0) + (card.imageUrl ? 1 : 0); + const galleryCount = card.extraMedia?.length || 0; + const isExternalLink = card.cardType === 'EXTERNAL_LINK'; // Fall back to the first gallery item when no explicit cover is set. const previewUrl = card.imageUrl || card.extraMedia?.[0]?.url || ''; const previewIsVideo = !!previewUrl && isVideoUrl(previewUrl); @@ -489,12 +490,20 @@ export default function PublicGrid({ cards, maxCols = 5 }: { cards: Card[], maxC ) : (
No Image
)} - {galleryCount > 1 && ( + {isExternalLink ? ( +
+ L +
+ ) : galleryCount > 0 ? (
{galleryCount}
- )} + ) : null}

{card.title}

@@ -528,7 +537,6 @@ export default function PublicGrid({ cards, maxCols = 5 }: { cards: Card[], maxC

{(activeCard.title || activeCard.shortDescription || activeCard.fullContent || activeCard.actionUrl) && (
-
{activeCard.cardType.replace('_', ' ')}
{activeCard.title && (

{activeCard.title}