diff --git a/Client/src/Components/Dialog/genericDialog.jsx b/Client/src/Components/Dialog/genericDialog.jsx new file mode 100644 index 000000000..2807b2e8c --- /dev/null +++ b/Client/src/Components/Dialog/genericDialog.jsx @@ -0,0 +1,45 @@ +import { Modal, Stack } from "@mui/material"; +import PropTypes from "prop-types"; +const GenericDialog = ({ title, description, open, onClose, theme, children }) => { + return ( + + + {children} + + + ); +}; + +GenericDialog.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string.isRequired, + open: PropTypes.bool.isRequired, + onClose: PropTypes.func.isRequired, + theme: PropTypes.object.isRequired, + children: PropTypes.element.isRequired, +}; + +export { GenericDialog }; diff --git a/Client/src/Components/Dialog/index.jsx b/Client/src/Components/Dialog/index.jsx index 55ec801d7..d87baa42a 100644 --- a/Client/src/Components/Dialog/index.jsx +++ b/Client/src/Components/Dialog/index.jsx @@ -1,6 +1,7 @@ import LoadingButton from "@mui/lab/LoadingButton"; -import { Button, Modal, Stack, Typography } from "@mui/material"; +import { Button, Stack, Typography } from "@mui/material"; import PropTypes from "prop-types"; +import { GenericDialog } from "./genericDialog"; const Dialog = ({ modelTitle, modelDescription, @@ -16,72 +17,53 @@ const Dialog = ({ description, }) => { return ( - - + {title} + + {description && ( - {title} + {description} - {description && ( - - {description} - - )} - + - - {confirmationBtnLbl} - - + {cancelBtnLbl} + + + {confirmationBtnLbl} + - + ); };