Made statuslabel look better

This commit is contained in:
Shay Nehmad 2019-08-15 10:54:30 +03:00
parent e4cf3706ec
commit 3d96f71988
1 changed files with 15 additions and 8 deletions

View File

@ -2,22 +2,29 @@ import React, {Component, Fragment} from "react";
import * as PropTypes from "prop-types";
const statusToIcon = {
"Positive": "fa-check status-success",
"Inconclusive": "fa-exclamation-triangle status-warning",
"Conclusive": "fa-bomb status-danger",
"Unexecuted": "fa-question status-default",
"Positive": "fa-check",
"Inconclusive": "fa-exclamation-triangle",
"Conclusive": "fa-bomb",
"Unexecuted": "fa-question",
};
const statusToLabelType = {
"Positive": "label-success",
"Inconclusive": "label-warning",
"Conclusive": "label-danger",
"Unexecuted": "label-default",
};
export class StatusLabel extends Component {
render() {
const classname = "fa " + statusToIcon[this.props.status] + " " + this.props.size;
let text = "";
if (this.props.showText) {
text = " " + this.props.status;
}
return (<Fragment>
<i className={classname}/>{text}
</Fragment>);
return (<div className={"label " + statusToLabelType[this.props.status]} style={{display: "flow-root"}}>
<i className={"fa " + statusToIcon[this.props.status] + " " + this.props.size}/>{text}
</div>);
}
}