modal
This commit is contained in:
parent
e74f247415
commit
58ef46a85c
5 changed files with 388 additions and 303 deletions
29
frontend/src/components/Modal.tsx
Normal file
29
frontend/src/components/Modal.tsx
Normal file
|
@ -0,0 +1,29 @@
|
|||
import "../css/Modal.css"
|
||||
|
||||
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 (
|
||||
<div className="modal-overlay" onClick={onClose}>
|
||||
<div className="modal-content" onClick={(e) => e.stopPropagation()}>
|
||||
<div className="modal-msg">
|
||||
<span aria-labelledby="message">{message}</span>
|
||||
</div>
|
||||
<div className="modal-buttons">
|
||||
<button onClick={confirmAction}>Yes, Delete</button>
|
||||
<button onClick={cancelAction}>Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Modal;
|
Loading…
Add table
Add a link
Reference in a new issue