import React from 'react'; import style from './InfoHeaderItem.module.css'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {Spinner} from 'react-bootstrap'; import {IconDefinition} from '@fortawesome/fontawesome-common-types'; interface props { onClick?: () => void backColor: string icon: IconDefinition text: string | number subtext: string | number } /** * a component to display one of the short quickinfo tiles on dashboard */ class InfoHeaderItem extends React.Component { render(): JSX.Element { return (
{ // call clicklistener if defined if (this.props.onClick != null) this.props.onClick(); }} className={style.infoheaderitem} style={{backgroundColor: this.props.backColor}}>
{this.props.text !== null && this.props.text !== undefined ? <>
{this.props.text}
{this.props.subtext}
: }
); } } export default InfoHeaderItem;