mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 17:31:14 -05:00
Fix submission display issues
This commit is contained in:
@@ -182,6 +182,90 @@ export const SystemActivityLog = forwardRef<SystemActivityLogRef, SystemActivity
|
||||
case 'submission_review': {
|
||||
const details = activity.details as SubmissionReviewDetails;
|
||||
const statusColor = details.status === 'approved' ? 'bg-green-500/10 text-green-500' : 'bg-red-500/10 text-red-500';
|
||||
|
||||
// Special handling for photo deletion submissions
|
||||
if (details.submission_type === 'photo_delete' && details.photo_url) {
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center gap-2 text-sm flex-wrap">
|
||||
<Badge className={statusColor}>
|
||||
{details.status}
|
||||
</Badge>
|
||||
<Trash2 className="h-4 w-4 text-muted-foreground" />
|
||||
<span className="text-muted-foreground">Photo deletion</span>
|
||||
{details.entity_type && (
|
||||
<span className="text-muted-foreground">
|
||||
from {details.entity_type}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex gap-3 items-start">
|
||||
<img
|
||||
src={details.photo_url}
|
||||
alt={details.photo_title || details.photo_caption || 'Deleted photo'}
|
||||
className="w-20 h-20 object-cover rounded border"
|
||||
/>
|
||||
<div className="flex-1 space-y-1">
|
||||
{details.photo_title && (
|
||||
<p className="text-sm font-medium">{details.photo_title}</p>
|
||||
)}
|
||||
{details.photo_caption && (
|
||||
<p className="text-sm text-muted-foreground">{details.photo_caption}</p>
|
||||
)}
|
||||
{details.deletion_reason && (
|
||||
<div className="flex items-start gap-2 mt-2 p-2 bg-muted rounded text-sm">
|
||||
<AlertCircle className="h-4 w-4 mt-0.5 flex-shrink-0" />
|
||||
<span className="text-muted-foreground">
|
||||
<strong>Reason:</strong> {details.deletion_reason}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Special handling for photo additions
|
||||
if (details.submission_type === 'photo' && details.photo_url) {
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<div className="flex items-center gap-2 text-sm flex-wrap">
|
||||
<Badge className={statusColor}>
|
||||
{details.status}
|
||||
</Badge>
|
||||
<ImageIcon className="h-4 w-4 text-muted-foreground" />
|
||||
<span className="text-muted-foreground">Photo submission</span>
|
||||
{details.entity_type && (
|
||||
<span className="text-muted-foreground">
|
||||
to {details.entity_type}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isExpanded && (
|
||||
<div className="flex gap-3 items-start">
|
||||
<img
|
||||
src={details.photo_url}
|
||||
alt={details.photo_title || details.photo_caption || 'Photo'}
|
||||
className="w-20 h-20 object-cover rounded border"
|
||||
/>
|
||||
<div className="flex-1 space-y-1">
|
||||
{details.photo_title && (
|
||||
<p className="text-sm font-medium">{details.photo_title}</p>
|
||||
)}
|
||||
{details.photo_caption && (
|
||||
<p className="text-sm text-muted-foreground">{details.photo_caption}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Generic submission display
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2 text-sm">
|
||||
|
||||
Reference in New Issue
Block a user