2020-10-25 18:48:23 +00:00
|
|
|
import React from 'react';
|
2020-10-19 21:12:07 +00:00
|
|
|
import style from './InfoHeaderItem.module.css';
|
2020-10-25 18:48:23 +00:00
|
|
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
|
|
|
import {Spinner} from 'react-bootstrap';
|
2020-10-19 21:12:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* a component to display one of the short quickinfo tiles on dashboard
|
|
|
|
*/
|
|
|
|
class InfoHeaderItem extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div onClick={() => {
|
|
|
|
// call clicklistener if defined
|
|
|
|
if (this.props.onClick != null) this.props.onClick();
|
|
|
|
}} className={style.infoheaderitem} style={{backgroundColor: this.props.backColor}}>
|
|
|
|
<div className={style.icon}>
|
|
|
|
<FontAwesomeIcon style={{
|
2020-10-25 18:48:23 +00:00
|
|
|
verticalAlign: 'middle',
|
|
|
|
lineHeight: '130px'
|
2020-10-19 21:12:07 +00:00
|
|
|
}} icon={this.props.icon} size='5x'/>
|
|
|
|
</div>
|
|
|
|
{this.props.text !== null && this.props.text !== undefined ?
|
|
|
|
<>
|
|
|
|
<div className={style.maintext}>{this.props.text}</div>
|
|
|
|
<div className={style.subtext}>{this.props.subtext}</div>
|
|
|
|
</>
|
|
|
|
: <span className={style.loadAnimation}><Spinner animation='border'/></span>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default InfoHeaderItem;
|