mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* Add spinner for running query * fixing lint * Adding in check for this.socket * Full height results area with centered spinner * Don't hide table if query is stopped * Remove results container if no results yet * No more console.log
27 lines
698 B
JavaScript
27 lines
698 B
JavaScript
import React, { Component, PropTypes } from 'react';
|
|
import classnames from 'classnames';
|
|
import { round } from 'lodash';
|
|
|
|
const baseClass = 'progress-bar';
|
|
|
|
class ProgressBar extends Component {
|
|
static propTypes = {
|
|
className: PropTypes.string,
|
|
max: PropTypes.number.isRequired,
|
|
value: PropTypes.number.isRequired,
|
|
};
|
|
|
|
render () {
|
|
const { className, max, value } = this.props;
|
|
const percentComplete = `${(round((value / (max || 1)) * 100, 0))}%`;
|
|
const wrapperClassName = classnames(baseClass, className);
|
|
|
|
return (
|
|
<div className={wrapperClassName}>
|
|
<div style={{ width: percentComplete }} />
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default ProgressBar;
|