Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

75 righe
2.4 KiB

  1. import React, {
  2. // useEffect,
  3. // useState
  4. } from 'react';
  5. // material-ui
  6. import {
  7. Button,
  8. // Link,
  9. Stack,
  10. Typography,
  11. Dialog,
  12. DialogActions,
  13. DialogContent,
  14. DialogContentText,
  15. DialogTitle
  16. } from '@mui/material';
  17. import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined';
  18. import {FormattedMessage} from "react-intl";
  19. const PasswordAlertDialog = (props) => {
  20. return (
  21. <Dialog
  22. open={props.open}
  23. onClose={props.handleClose}
  24. aria-labelledby="alert-dialog-title"
  25. aria-describedby="alert-dialog-description"
  26. >
  27. <DialogTitle id="alert-dialog-title">
  28. <Stack mt={1} mr={4} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
  29. <CancelOutlinedIcon color="error" sx={{ width: "35px", height: "40px" }} />
  30. {
  31. props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ?
  32. <Stack direction="column">
  33. <Typography display="inline">
  34. <FormattedMessage id="loginErrorMessage1"/>
  35. </Typography>
  36. <Typography display="inline">
  37. <FormattedMessage id="loginErrorMessage2"/>
  38. </Typography>
  39. </Stack> :
  40. props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ?
  41. <Typography display="inline">
  42. <FormattedMessage id="loginErrorMessage3"/>
  43. </Typography> :
  44. props.errorMassage === 'CONNECTION_ERROR' ?
  45. <Typography display="inline">
  46. <FormattedMessage id="loginErrorMessage4"/>
  47. </Typography>:
  48. props.errorMassage === 'PUBLIC_LOGIN_DISABLE' ?
  49. <Typography display="inline">
  50. <FormattedMessage id="loginErrorMessage7"/>
  51. </Typography>:
  52. <Typography display="inline">
  53. <FormattedMessage id="loginErrorMessage5"/>
  54. </Typography>
  55. }
  56. </Stack>
  57. </DialogTitle>
  58. <DialogContent>
  59. <DialogContentText id="alert-dialog-description">
  60. {""}
  61. </DialogContentText>
  62. </DialogContent>
  63. <DialogActions>
  64. <Button variant="contained" color="error" onClick={props.handleClose} autoFocus>
  65. <FormattedMessage id="close"/>
  66. </Button>
  67. </DialogActions>
  68. </Dialog>
  69. );
  70. };
  71. export default PasswordAlertDialog;