mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 23:31:12 -05:00
Refactor: Database and UI updates
This commit is contained in:
@@ -179,29 +179,30 @@ export const QueueItem = memo(({
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{item.content.photos && item.content.photos.length > 0 && (() => {
|
||||
const reviewPhotos: PhotoItem[] = normalizePhotoData({
|
||||
type: 'review',
|
||||
photos: item.content.photos
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="mt-3">
|
||||
<div className="text-sm font-medium mb-2">Attached Photos:</div>
|
||||
<PhotoGrid
|
||||
photos={reviewPhotos}
|
||||
onPhotoClick={(photos, index) => onOpenPhotos(photos as any, index)}
|
||||
maxDisplay={isMobile ? 3 : 4}
|
||||
className="grid-cols-2 md:grid-cols-3"
|
||||
/>
|
||||
{item.content.photos[0]?.caption && (
|
||||
<p className="text-sm text-muted-foreground mt-2">
|
||||
{item.content.photos[0].caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
{/* Review photos are now in relational review_photos table, not JSONB */}
|
||||
{item.review_photos && item.review_photos.length > 0 && (
|
||||
<div className="mt-3">
|
||||
<div className="text-sm font-medium mb-2">Attached Photos:</div>
|
||||
<PhotoGrid
|
||||
photos={item.review_photos.map(photo => ({
|
||||
id: photo.id,
|
||||
url: photo.url,
|
||||
filename: photo.url.split('/').pop() || 'photo.jpg',
|
||||
caption: photo.caption || undefined,
|
||||
title: undefined,
|
||||
order: photo.order_index
|
||||
}))}
|
||||
onPhotoClick={(photos, index) => onOpenPhotos(photos as any, index)}
|
||||
maxDisplay={isMobile ? 3 : 4}
|
||||
className="grid-cols-2 md:grid-cols-3"
|
||||
/>
|
||||
{item.review_photos[0]?.caption && (
|
||||
<p className="text-sm text-muted-foreground mt-2">
|
||||
{item.review_photos[0].caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : item.submission_type === 'photo' ? (
|
||||
<PhotoSubmissionDisplay
|
||||
|
||||
Reference in New Issue
Block a user