summaryrefslogtreecommitdiff
path: root/src2/components/elements/ConfirmAlert.js
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-03-01 09:18:52 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-03-01 09:18:52 +0000
commita7abbf4ddc70068620e9f44b74dc162ce2e16ee2 (patch)
tree74f66253717515d364ce74bd8275015c1f829cbc /src2/components/elements/ConfirmAlert.js
parent90e1edab9b6a8ccc09a49fed3addbec2cbc4e4c3 (diff)
parenta1b9b647a6c4bda1f5db63879639d44543f9557e (diff)
Merged in refactor (pull request #1)
Refactor
Diffstat (limited to 'src2/components/elements/ConfirmAlert.js')
-rw-r--r--src2/components/elements/ConfirmAlert.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/src2/components/elements/ConfirmAlert.js b/src2/components/elements/ConfirmAlert.js
new file mode 100644
index 00000000..d33abb89
--- /dev/null
+++ b/src2/components/elements/ConfirmAlert.js
@@ -0,0 +1,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-[90%] 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; \ No newline at end of file