1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/component/common/ApiError/ApiError.tsx

34 lines
696 B
TypeScript
Raw Normal View History

import { Button } from '@material-ui/core';
import { Alert } from '@material-ui/lab';
interface IApiErrorProps {
className?: string;
onClick: () => void;
text: string;
style?: React.CSSProperties;
}
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;