import * as React from 'react'; import PropTypes from 'prop-types'; import LoadingButton from '@mui/lab/LoadingButton'; import Alert from '@mui/material/Alert'; import Dialog from '@mui/material/Dialog'; import DialogContent from '@mui/material/DialogContent'; import DialogContentText from '@mui/material/DialogContentText'; import DialogTitle from '@mui/material/DialogTitle'; import CircularProgress from '@mui/material/CircularProgress'; import { FieldPropType } from 'propTypes/propTypes'; import useFormatMessage from 'hooks/useFormatMessage'; import InputCreator from 'components/InputCreator'; import Switch from 'components/Switch'; import TextField from 'components/TextField'; import { Form } from './style'; function AdminApplicationAuthClientDialog(props) { const { error, onClose, title, loading, submitHandler, authFields, submitting, defaultValues, disabled = false, } = props; const formatMessage = useFormatMessage(); return ( {title} {error && ( {error.message} )} {loading ? ( ) : (
( <> {authFields?.map((field) => ( ))} {formatMessage('authClient.buttonSubmit')} )} >
)}
); } AdminApplicationAuthClientDialog.propTypes = { error: PropTypes.shape({ message: PropTypes.string, }), onClose: PropTypes.func.isRequired, title: PropTypes.string.isRequired, loading: PropTypes.bool.isRequired, submitHandler: PropTypes.func.isRequired, authFields: PropTypes.arrayOf(FieldPropType), submitting: PropTypes.bool.isRequired, defaultValues: PropTypes.object.isRequired, disabled: PropTypes.bool, }; export default AdminApplicationAuthClientDialog;