UNPKG

@brightlayer-ui/react-auth-workflow

Version:

Re-usable workflow components for Authentication and Registration within Eaton applications.

39 lines (38 loc) 1.58 kB
import React from 'react'; import Button from '@mui/material/Button'; import Dialog from '@mui/material/Dialog'; import Typography from '@mui/material/Typography'; import DialogTitle from '@mui/material/DialogTitle'; import DialogContent from '@mui/material/DialogContent'; import DialogActions from '@mui/material/DialogActions'; /** * Component that renders a basic dialog with a title, body description, and a close button. * * @param {BasicDialogProps} props - basic props of Dialog * * @category Component */ export const BasicDialog = (props) => { const { title, body, dismissButtonText, open = false, sx, ...dialogProps } = props; return (React.createElement(Dialog, { sx: sx, ...dialogProps, open: open }, React.createElement(DialogTitle, { sx: { pt: { md: 4, sm: 2 }, px: { md: 3, sm: 2 }, pb: 0, } }, title), React.createElement(DialogContent, { sx: { flex: '1 1 auto', overflow: 'auto', display: 'flex', flexDirection: 'column', pt: 2, px: { md: 3, sm: 2 }, pb: { md: 2, sm: 3 }, } }, React.createElement(Typography, null, body)), React.createElement(DialogActions, { sx: { justifyContent: 'flex-end', p: { md: 3, sm: 2 }, } }, React.createElement(Button, { variant: "text", color: "primary", onClick: dialogProps.onClose, sx: { width: 100 } }, dismissButtonText || 'Okay')))); };