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 |
8754af5c
|
Vaclav Honzik
|
<Typography sx={{mb: 1}} align="center" variant="h6" color="error" fontWeight="bold">
|
13 |
4a2ac9a8
|
Vaclav Honzik
|
{err}
|
14 |
|
|
</Typography>
|
15 |
|
|
) : null}
|
16 |
|
|
</Fragment>
|
17 |
|
|
)
|
18 |
|
|
|
19 |
|
|
export default ShowErrorIfPresent
|