@@ -2,7 +2,7 @@ import { useId } from "react";
22import PropTypes from "prop-types" ;
33import { Modal , Stack , Typography } from "@mui/material" ;
44
5- const GenericDialog = ( { title, description, open, onClose, theme, children } ) => {
5+ const GenericDialog = ( { title, description, open, onClose, theme, children, width } ) => {
66 const titleId = useId ( ) ;
77 const descriptionId = useId ( ) ;
88 const ariaDescribedBy = description ?. length > 0 ? descriptionId : "" ;
@@ -16,6 +16,7 @@ const GenericDialog = ({ title, description, open, onClose, theme, children }) =
1616 >
1717 < Stack
1818 gap = { theme . spacing ( 2 ) }
19+ width = { width }
1920 sx = { {
2021 position : "absolute" ,
2122 top : "50%" ,
@@ -39,13 +40,15 @@ const GenericDialog = ({ title, description, open, onClose, theme, children }) =
3940 fontSize = { 16 }
4041 color = { theme . palette . primary . contrastText }
4142 fontWeight = { 600 }
43+ marginBottom = { theme . spacing ( 4 ) }
4244 >
4345 { title }
4446 </ Typography >
4547 { description && (
4648 < Typography
4749 id = { descriptionId }
4850 color = { theme . palette . primary . contrastTextTertiary }
51+ marginBottom = { theme . spacing ( 4 ) }
4952 >
5053 { description }
5154 </ Typography >
@@ -64,6 +67,7 @@ GenericDialog.propTypes = {
6467 theme : PropTypes . object . isRequired ,
6568 children : PropTypes . oneOfType ( [ PropTypes . arrayOf ( PropTypes . node ) , PropTypes . node ] )
6669 . isRequired ,
70+ width : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number , PropTypes . object ] ) ,
6771} ;
6872
6973export { GenericDialog } ;
0 commit comments