Refactor: Approve tool use

This commit is contained in:
gpt-engineer-app[bot]
2025-10-06 18:24:20 +00:00
parent c2c70524f7
commit 63a7877314
4 changed files with 175 additions and 33 deletions

View File

@@ -85,6 +85,33 @@ export function SubmissionChangesDisplay({
);
if (view === 'summary') {
// Special compact display for photo deletions
if (item.item_type === 'photo_delete') {
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2 flex-wrap">
{getEntityIcon()}
<span className="font-medium">{changes.entityName}</span>
{getActionBadge()}
</div>
{changes.photoChanges.length > 0 && changes.photoChanges[0].type === 'deleted' && (
<PhotoDeletionPreview
photo={{
url: changes.photoChanges[0].photo?.url || item.item_data?.cloudflare_image_url || '',
title: changes.photoChanges[0].photo?.title || item.item_data?.title,
caption: changes.photoChanges[0].photo?.caption || item.item_data?.caption,
entity_type: item.item_data?.entity_type,
entity_name: changes.entityName,
deletion_reason: changes.photoChanges[0].photo?.deletion_reason || item.item_data?.deletion_reason || item.item_data?.reason
}}
compact={true}
/>
)}
</div>
);
}
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2 flex-wrap">
@@ -146,7 +173,34 @@ export function SubmissionChangesDisplay({
);
}
// Detailed view
// Detailed view - special handling for photo deletions
if (item.item_type === 'photo_delete') {
return (
<div className="flex flex-col gap-4">
<div className="flex items-center gap-2">
{getEntityIcon()}
<h3 className="text-lg font-semibold">{changes.entityName}</h3>
{getActionBadge()}
</div>
{changes.photoChanges.length > 0 && changes.photoChanges[0].type === 'deleted' && (
<PhotoDeletionPreview
photo={{
url: changes.photoChanges[0].photo?.url || item.item_data?.cloudflare_image_url || '',
title: changes.photoChanges[0].photo?.title || item.item_data?.title,
caption: changes.photoChanges[0].photo?.caption || item.item_data?.caption,
entity_type: item.item_data?.entity_type,
entity_name: changes.entityName,
deletion_reason: changes.photoChanges[0].photo?.deletion_reason || item.item_data?.deletion_reason || item.item_data?.reason
}}
compact={false}
/>
)}
</div>
);
}
// Detailed view for other items
return (
<div className="flex flex-col gap-4">
<div className="flex items-center gap-2">