diff --git a/mnemo_cards_admin/src/pages/CardsPage.tsx b/mnemo_cards_admin/src/pages/CardsPage.tsx index 498a27b..03fda69 100644 --- a/mnemo_cards_admin/src/pages/CardsPage.tsx +++ b/mnemo_cards_admin/src/pages/CardsPage.tsx @@ -247,6 +247,20 @@ export default function CardsPage() { return pack?.title || packId } + // Get image source - handles both base64 and URLs + const getImageSrc = (image?: string): string | undefined => { + if (!image) return undefined + + // If it's already a data URL or http/https URL, return as is + if (image.startsWith('data:') || image.startsWith('http://') || image.startsWith('https://')) { + return image + } + + // Otherwise, assume it's base64 and add the data URL prefix + // Try to detect image type from base64 or default to png + return `data:image/png;base64,${image}` + } + if (error) { const errorMessage = isCardsApiError(error) ? error.message @@ -350,9 +364,14 @@ export default function CardsPage() { <> {Object.entries(groupedCards).map(([packId, cards]) => (
+ {cards.length} {cards.length === 1 ? 'card' : 'cards'} +
+