fleet/frontend/components/loaders/ProgressBar/ProgressBar.jsx
Kyle Knight 048938de0b Add spinner for running Query (#926)
* 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
2017-01-12 12:28:46 -06:00

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;