Fix submission display issues

This commit is contained in:
gpt-engineer-app[bot]
2025-10-06 17:59:34 +00:00
parent 25f79a4667
commit 2fc67ebf39
2 changed files with 132 additions and 6 deletions

View File

@@ -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">