import { useId } from "react"; import PropTypes from "prop-types"; import { Modal, Stack, Typography } from "@mui/material"; const GenericDialog = ({ title, description, open, onClose, theme, children }) => { const titleId = useId(); const descriptionId = useId(); const ariaDescribedBy = description?.length > 0 ? descriptionId : ""; return ( e.stopPropagation()} > {title} {description && ( {description} )} {children} ); }; GenericDialog.propTypes = { title: PropTypes.string.isRequired, description: PropTypes.string, open: PropTypes.bool.isRequired, onClose: PropTypes.func.isRequired, theme: PropTypes.object.isRequired, children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]) .isRequired, }; export { GenericDialog };