aswi2022code-of-duty-gitlab/frontend/src/features/Reusables/ShowErrorIfPresent.tsx @ 1c710f4f
1 | 4a2ac9a8 | Vaclav Honzik | import { Typography } from '@mui/material' |
---|---|---|---|
2 | import { Fragment, FunctionComponent } from 'react' |
||
3 | |||
4 | export interface ShowErrorProps { |
||
5 | err?: string |
||
6 | }
|
||
7 | |||
8 | // Utility component for showing error messages
|
||
9 | const ShowErrorIfPresent: FunctionComponent<ShowErrorProps> = ({ err }) => ( |
||
10 | <Fragment> |
||
11 | {err ? ( |
||
12 | <Typography align="center" variant="h6" fontWeight="400"> |
||
13 | {err} |
||
14 | </Typography> |
||
15 | ) : null} |
||
16 | </Fragment> |
||
17 | )
|
||
18 | |||
19 | export default ShowErrorIfPresent |