final commit
This commit is contained in:
1 parent
0ffbba3bed
commit
7b242b8685
39 files changed
+5524
-65
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import { AlertCircle } from 'lucide-react';
|
||||
import React from 'react';
|
||||
|
||||
interface DeleteConfirmationProps {
|
||||
item: any | null;
|
||||
onConfirm: () => Promise<void>;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
export function DeleteConfirmation({ item, onConfirm, onCancel }: DeleteConfirmationProps) {
|
||||
const handleConfirm = React.useCallback(async () => {
|
||||
await onConfirm();
|
||||
// Auto-close after confirmation by calling onCancel to dismiss overlay
|
||||
}, [onConfirm]);
|
||||
|
||||
return (
|
||||
<div className="delete-modal-overlay" onClick={onCancel}>
|
||||
<div className="delete-modal-content" onClick={(e) => e.stopPropagation()}>
|
||||
<div className="warning-icon">
|
||||
<AlertCircle size={48} color="#dc2626" />
|
||||
</div>
|
||||
<h3>Are you sure you want to delete "{item?.title || 'this item'}"?</h3>
|
||||
<p>This action cannot be undone and will permanently remove the content from the system.</p>
|
||||
|
||||
<div className="modal-actions">
|
||||
<button onClick={onCancel} className="btn-secondary">
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
onClick={handleConfirm}
|
||||
className="btn-danger"
|
||||
>
|
||||
Yes, Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user