You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 lines
1.9 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. {props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ?
  31. <Stack direction="column">
  32. <Typography display="inline">
  33. 帳戶將被封鎖
  34. </Typography>
  35. <Typography display="inline">
  36. 帳戶連續五次登入錯誤,請與系統管理員聯絡
  37. </Typography>
  38. </Stack> :
  39. props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ?
  40. <Typography display="inline">
  41. 帳戶尚未驗證
  42. </Typography> :
  43. <Typography display="inline">
  44. 用戶名或密碼錯誤
  45. </Typography>
  46. }
  47. </Stack>
  48. </DialogTitle>
  49. <DialogContent>
  50. <DialogContentText id="alert-dialog-description">
  51. {""}
  52. </DialogContentText>
  53. </DialogContent>
  54. <DialogActions>
  55. <Button variant="contained" color="error" onClick={props.handleClose} autoFocus>
  56. <FormattedMessage id="close"/>
  57. </Button>
  58. </DialogActions>
  59. </Dialog>
  60. );
  61. };
  62. export default PasswordAlertDialog;