diff --git a/app/components/SuccessModel.tsx b/app/components/SuccessModel.tsx new file mode 100644 index 00000000..ce6d8c25 --- /dev/null +++ b/app/components/SuccessModel.tsx @@ -0,0 +1,83 @@ +"use client"; + +import { useEffect, useState } from "react"; +import { createPortal } from "react-dom"; + +interface SuccessModalProperties { + isOpen: boolean; + onClose: () => void; +} + +export const SuccessModal: React.FC = ({ + isOpen, + onClose, +}) => { + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + return () => setMounted(false); + }, []); + + if (!isOpen || !mounted) return; + + return createPortal( +
+
+
+
+
+
+ + + +
+
+ +
+
+

Success

+

+ You have created your new role successfully! +

+ +
+
+
+
, + document.body, + ); +};