1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00
unleash.unleash/frontend/src/component/common/ApiError/ApiError.tsx
Ivar Conradi Østhus fe2a8311bf feat: created project header (#388)
* feat: created project header

* fix: remove reporting from global menu

* fix: add projects to global menu for oss also
2021-10-01 12:15:02 +02:00

34 lines
696 B
TypeScript

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;