JosepinPai commited on
Commit
d44a7a3
·
verified ·
1 Parent(s): 18cf87f

Upload components/ConfirmModal.jsx with huggingface_hub

Browse files
Files changed (1) hide show
  1. components/ConfirmModal.jsx +40 -0
components/ConfirmModal.jsx ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export default function ConfirmModal({ isOpen, onClose, onConfirm, title, message }) {
2
+ if (!isOpen) return null;
3
+
4
+ return (
5
+ <div className="fixed inset-0 z-50 overflow-y-auto">
6
+ <div className="flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:p-0">
7
+ {/* Backdrop */}
8
+ <div
9
+ className="fixed inset-0 bg-slate-900 bg-opacity-50 transition-opacity"
10
+ onClick={onClose}
11
+ ></div>
12
+
13
+ {/* Modal */}
14
+ <div className="relative bg-white rounded-2xl shadow-2xl max-w-sm w-full mx-auto z-10 transform transition-all p-6">
15
+ <div className="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4">
16
+ <svg className="w-6 h-6 text-red-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
17
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
18
+ </svg>
19
+ </div>
20
+ <h3 className="text-lg font-bold text-slate-800 mb-2">{title}</h3>
21
+ <p className="text-slate-500 mb-6">{message}</p>
22
+ <div className="flex gap-3">
23
+ <button
24
+ onClick={onClose}
25
+ className="btn-secondary flex-1"
26
+ >
27
+ Cancelar
28
+ </button>
29
+ <button
30
+ onClick={onConfirm}
31
+ className="btn-danger flex-1"
32
+ >
33
+ Eliminar
34
+ </button>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ );
40
+ }