2025-07-08 14:33:28 -07:00
|
|
|
interface ModalProps {
|
|
|
|
isOpen: boolean;
|
|
|
|
onClose: () => void;
|
|
|
|
message: string;
|
|
|
|
confirmAction: () => void;
|
|
|
|
cancelAction: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Modal = ({ isOpen, onClose, message, confirmAction, cancelAction }: ModalProps) => {
|
|
|
|
if (!isOpen) return null;
|
|
|
|
|
|
|
|
return (
|
2025-07-24 12:11:32 -07:00
|
|
|
<div className="modal-overlay fixed top-0 left-0 w-full h-full bg-black bg-opacity-50 flex justify-center items-center" onClick={onClose}>
|
|
|
|
<div className="modal-content bg-amber-200 p-12 rounded-md shadow-md" onClick={(e) => e.stopPropagation()}>
|
2025-07-08 14:33:28 -07:00
|
|
|
<div className="modal-msg">
|
|
|
|
<span aria-labelledby="message">{message}</span>
|
|
|
|
</div>
|
|
|
|
<div className="modal-buttons">
|
2025-07-24 12:11:32 -07:00
|
|
|
<button className="bg-amber-600 rounded-md m-4 pt-1 pb-1 pr-2 pl-2" onClick={confirmAction}>Yes, Delete</button>
|
|
|
|
<button className="bg-amber-600 rounded-md m-4 pt-1 pb-1 pr-2 pl-2" onClick={cancelAction}>Cancel</button>
|
2025-07-08 14:33:28 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Modal;
|