mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 11:31:11 -05:00
feat: Display photos in submissions
This commit is contained in:
@@ -557,8 +557,16 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
|||||||
<img
|
<img
|
||||||
src={photo.url}
|
src={photo.url}
|
||||||
alt={`Review photo ${index + 1}`}
|
alt={`Review photo ${index + 1}`}
|
||||||
className="w-full h-20 object-cover rounded border"
|
className="w-full h-20 object-cover rounded border bg-muted/30"
|
||||||
|
onError={(e) => {
|
||||||
|
console.error('Failed to load review photo:', photo.url);
|
||||||
|
(e.target as HTMLImageElement).style.display = 'none';
|
||||||
|
}}
|
||||||
|
onLoad={() => console.log('Review photo loaded:', photo.url)}
|
||||||
/>
|
/>
|
||||||
|
<div className="absolute inset-0 flex items-center justify-center bg-muted/80 text-xs text-muted-foreground opacity-0 hover:opacity-100 transition-opacity">
|
||||||
|
Photo {index + 1}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -593,12 +601,33 @@ export const ModerationQueue = forwardRef<ModerationQueueRef>((props, ref) => {
|
|||||||
<div className="text-sm font-medium">Photos ({item.content.photos.length}):</div>
|
<div className="text-sm font-medium">Photos ({item.content.photos.length}):</div>
|
||||||
{item.content.photos.map((photo: any, index: number) => (
|
{item.content.photos.map((photo: any, index: number) => (
|
||||||
<div key={index} className="border rounded-lg p-3 space-y-2">
|
<div key={index} className="border rounded-lg p-3 space-y-2">
|
||||||
|
<div className="relative min-h-[100px] bg-muted/30 rounded border overflow-hidden">
|
||||||
<img
|
<img
|
||||||
src={photo.url}
|
src={photo.url}
|
||||||
alt={`Photo ${index + 1}: ${photo.filename}`}
|
alt={`Photo ${index + 1}: ${photo.filename}`}
|
||||||
className="w-full max-h-64 object-contain rounded border bg-muted/30"
|
className="w-full max-h-64 object-contain rounded"
|
||||||
|
onError={(e) => {
|
||||||
|
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 = `
|
||||||
|
<div class="absolute inset-0 flex flex-col items-center justify-center text-destructive text-xs">
|
||||||
|
<div>⚠️ Image failed to load</div>
|
||||||
|
<div class="mt-1 font-mono text-xs break-all px-2">${photo.url}</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onLoad={() => console.log('Photo submission loaded:', photo.url)}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<div className="space-y-1 text-xs text-muted-foreground">
|
<div className="space-y-1 text-xs text-muted-foreground">
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="font-medium">URL:</span>
|
||||||
|
<span className="font-mono text-xs break-all">{photo.url}</span>
|
||||||
|
</div>
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<span className="font-medium">Filename:</span>
|
<span className="font-medium">Filename:</span>
|
||||||
<span>{photo.filename || 'Unknown'}</span>
|
<span>{photo.filename || 'Unknown'}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user