colouring-montreal/app/src/frontend/error-box.js

24 lines
613 B
JavaScript
Raw Normal View History

2018-09-13 11:58:05 -04:00
import React, { Fragment } from 'react';
2018-09-13 18:55:53 -04:00
function ErrorBox(props){
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>
);
}
2018-09-13 11:58:05 -04:00
export default ErrorBox;