feat: save/load operator info feat: add formik switch component feat: add input validation fix: correct formik switch behaviour fix: change infoCardEnabled to a radio input style: move styles out of js feat: add error feedback
41 lines
896 B
JavaScript
41 lines
896 B
JavaScript
import React from 'react'
|
|
import classnames from 'classnames'
|
|
import { makeStyles } from '@material-ui/core'
|
|
|
|
import { ReactComponent as ErrorIcon } from 'src/styling/icons/warning-icon/tomato.svg'
|
|
import { errorColor } from 'src/styling/variables'
|
|
|
|
import { Info3 } from './typography'
|
|
|
|
const styles = {
|
|
wrapper: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
'& > svg': {
|
|
marginRight: 10
|
|
}
|
|
},
|
|
message: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
color: errorColor,
|
|
margin: 0,
|
|
whiteSpace: 'break-spaces',
|
|
width: 250
|
|
}
|
|
}
|
|
|
|
const useStyles = makeStyles(styles)
|
|
|
|
const ErrorMessage = ({ className, children, ...props }) => {
|
|
const classes = useStyles()
|
|
|
|
return (
|
|
<div className={classnames(classes.wrapper, className)}>
|
|
<ErrorIcon />
|
|
<Info3 className={classes.message}>{children}</Info3>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default ErrorMessage
|