2018-09-13 15:41:42 -04:00
|
|
|
import React, { Fragment } from 'react';
|
2019-05-27 13:26:29 -04:00
|
|
|
import PropTypes from 'prop-types';
|
2018-09-13 15:41:42 -04:00
|
|
|
|
|
|
|
const InfoBox = (props) => (
|
|
|
|
<Fragment>
|
|
|
|
{
|
2018-11-21 16:08:55 -05:00
|
|
|
(props.msg || props.children)?
|
2019-05-27 11:39:16 -04:00
|
|
|
(
|
|
|
|
<div className="alert alert-info" role="alert">
|
|
|
|
{
|
|
|
|
(typeof props.msg === 'string' || props.msg instanceof String)?
|
|
|
|
props.msg
|
|
|
|
: 'Enjoy the colouring! Usual service should resume shortly.'
|
|
|
|
}
|
|
|
|
{
|
|
|
|
props.children
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
) : null
|
2018-09-13 15:41:42 -04:00
|
|
|
}
|
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
|
2019-05-27 13:26:29 -04:00
|
|
|
InfoBox.propTypes = {
|
|
|
|
msg: PropTypes.string,
|
|
|
|
children: PropTypes.node
|
|
|
|
}
|
|
|
|
|
2018-09-13 15:41:42 -04:00
|
|
|
export default InfoBox;
|