@afzalimdad9/react-alert-template-mui
Version:
react alert template using mui
17 lines • 1.13 kB
JavaScript
import React from "react";
import { Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Button } from '@mui/material';
const AlertDialog = ({ close, message, options }) => {
return (React.createElement(Dialog, { open: true, onClose: close, keepMounted: true, "aria-labelledby": "alert-dialog-slide-title", "aria-describedby": "alert-dialog-slide-description" },
React.createElement(DialogTitle, { id: "alert-dialog-slide-title" }, options.title),
React.createElement(DialogContent, null,
React.createElement(DialogContentText, { id: "alert-dialog-slide-description" }, message)),
React.createElement(DialogActions, null,
options.actions &&
options.actions.map((action, index) => (React.createElement(Button, { onClick: () => {
action.onClick();
close();
}, color: "primary", key: index }, action.copy))),
React.createElement(Button, { onClick: close, color: "primary" }, options.closeCopy || "Okay"))));
};
export default AlertDialog;
//# sourceMappingURL=index.js.map