blob: 4bb60ffb9473be308f42f918dd55aa0fbc677ec9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import React from 'react';
import { Alert } from '@mui/material';
import { isFetchBaseQueryError } from '../error';
import type { StatusProps } from '../models';
import type { Data } from '../error';
const Status = ({ error, setOpen, type }: StatusProps) => {
return isFetchBaseQueryError(error) ? (
<Alert severity="error" onClose={() => setOpen(false)}>
{(error.data as Data).message}
</Alert>
) : (
<Alert severity="error" onClose={() => setOpen(false)}>
{`${type} login failed`}
</Alert>
);
};
export default Status;
|