Show error feedback when run deletion is blocked
Add optional error prop to DeleteConfirmModal and wire it into AdminRuns so the backend's rejection message is displayed to the user. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ interface DeleteConfirmModalProps {
|
|||||||
onConfirm: () => void
|
onConfirm: () => void
|
||||||
onCancel: () => void
|
onCancel: () => void
|
||||||
isDeleting?: boolean
|
isDeleting?: boolean
|
||||||
|
error?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DeleteConfirmModal({
|
export function DeleteConfirmModal({
|
||||||
@@ -12,6 +13,7 @@ export function DeleteConfirmModal({
|
|||||||
onConfirm,
|
onConfirm,
|
||||||
onCancel,
|
onCancel,
|
||||||
isDeleting,
|
isDeleting,
|
||||||
|
error,
|
||||||
}: DeleteConfirmModalProps) {
|
}: DeleteConfirmModalProps) {
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
<div className="fixed inset-0 z-50 flex items-center justify-center">
|
||||||
@@ -24,6 +26,11 @@ export function DeleteConfirmModal({
|
|||||||
<p className="mt-2 text-sm text-gray-600 dark:text-gray-300">
|
<p className="mt-2 text-sm text-gray-600 dark:text-gray-300">
|
||||||
{message}
|
{message}
|
||||||
</p>
|
</p>
|
||||||
|
{error && (
|
||||||
|
<p className="mt-2 text-sm text-red-600 dark:text-red-400">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="px-6 py-4 border-t border-gray-200 dark:border-gray-700 flex justify-end gap-3">
|
<div className="px-6 py-4 border-t border-gray-200 dark:border-gray-700 flex justify-end gap-3">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -120,8 +120,9 @@ export function AdminRuns() {
|
|||||||
onSuccess: () => setDeleting(null),
|
onSuccess: () => setDeleting(null),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onCancel={() => setDeleting(null)}
|
onCancel={() => { setDeleting(null); deleteRun.reset() }}
|
||||||
isDeleting={deleteRun.isPending}
|
isDeleting={deleteRun.isPending}
|
||||||
|
error={deleteRun.error?.message ?? null}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user