blob: 37e6a4504bcf40e59b945e7be728b9300e4212c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
const ConfirmAlert = ({
title,
caption,
show,
onClose,
onSubmit,
closeText,
submitText
}) => {
return (
<>
{show && (
<div className="menu-overlay" onClick={onClose}></div>
)}
<div className={"p-4 rounded border bg-white border-gray_r-6 fixed top-[50%] left-[50%] translate-x-[-50%] z-[70] w-[80%] translate-y-[-50%] " + (show ? "block" : "hidden")}>
<p className="h2 mb-2">{title}</p>
<p className="text-gray_r-11 mb-6">{caption}</p>
<div className="flex gap-x-2">
<button className="flex-1 btn-yellow" onClick={onClose}>{closeText}</button>
<button className="flex-1 btn-solid-red" onClick={onSubmit}>{submitText}</button>
</div>
</div>
</>
);
};
export default ConfirmAlert;
|