colouring-montreal/app/src/frontend/error-box.js
2018-09-30 20:30:04 +01:00

26 lines
644 B
JavaScript

import React, { Fragment } from 'react';
function ErrorBox(props){
if (props.msg) {
console.error(props.msg);
}
return (
<Fragment>
{
(props.msg)?
(
<div className="alert alert-danger" role="alert">
{
(typeof props.msg === 'string' || props.msg instanceof String)?
props.msg
: 'Unexpected error'
}
</div>
) : null
}
</Fragment>
);
}
export default ErrorBox;