2021-07-07 11:04:36 +02:00
|
|
|
import { Button } from '@material-ui/core';
|
|
|
|
import { Alert } from '@material-ui/lab';
|
|
|
|
|
|
|
|
interface IApiErrorProps {
|
|
|
|
className?: string;
|
|
|
|
onClick: () => void;
|
|
|
|
text: string;
|
2021-10-01 12:15:02 +02:00
|
|
|
style?: React.CSSProperties;
|
2021-07-07 11:04:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const ApiError: React.FC<IApiErrorProps> = ({
|
|
|
|
className,
|
|
|
|
onClick,
|
|
|
|
text,
|
|
|
|
...rest
|
|
|
|
}) => {
|
|
|
|
return (
|
|
|
|
<Alert
|
|
|
|
className={className ? className : ''}
|
|
|
|
action={
|
|
|
|
<Button color="inherit" size="small" onClick={onClick}>
|
|
|
|
TRY AGAIN
|
|
|
|
</Button>
|
|
|
|
}
|
|
|
|
severity="error"
|
|
|
|
{...rest}
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</Alert>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ApiError;
|