From 9b3bc388add030c818567da59b588f7757d0b6ee Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 00:59:26 +0000 Subject: [PATCH] feat: Display photos in submissions --- src/components/moderation/ModerationQueue.tsx | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/src/components/moderation/ModerationQueue.tsx b/src/components/moderation/ModerationQueue.tsx index 58ca12c0..a266bfc6 100644 --- a/src/components/moderation/ModerationQueue.tsx +++ b/src/components/moderation/ModerationQueue.tsx @@ -548,7 +548,7 @@ export const ModerationQueue = forwardRef((props, ref) => {
Rating: {item.content.rating}/5
- {item.content.photos && item.content.photos.length > 0 && ( + {item.content.photos && item.content.photos.length > 0 && (
Attached Photos:
@@ -557,8 +557,16 @@ export const ModerationQueue = forwardRef((props, ref) => { {`Review { + console.error('Failed to load review photo:', photo.url); + (e.target as HTMLImageElement).style.display = 'none'; + }} + onLoad={() => console.log('Review photo loaded:', photo.url)} /> +
+ Photo {index + 1} +
))}
@@ -587,18 +595,39 @@ export const ModerationQueue = forwardRef((props, ref) => { )} - {/* Photos */} + {/* Photos */} {item.content.photos && item.content.photos.length > 0 ? (
Photos ({item.content.photos.length}):
{item.content.photos.map((photo: any, index: number) => (
- {`Photo +
+ {`Photo { + console.error('Failed to load photo submission:', photo); + const target = e.target as HTMLImageElement; + target.style.display = 'none'; + const parent = target.parentElement; + if (parent) { + parent.innerHTML = ` +
+
⚠️ Image failed to load
+
${photo.url}
+
+ `; + } + }} + onLoad={() => console.log('Photo submission loaded:', photo.url)} + /> +
+
+ URL: + {photo.url} +
Filename: {photo.filename || 'Unknown'}