2018-10-12 13:02:01 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2020-03-17 12:15:19 +00:00
|
|
|
import { formatNumber } from '../../helpers/helpers';
|
|
|
|
|
|
|
|
const Cell = ({ value, percent, color }) => (
|
2018-10-12 13:02:01 +00:00
|
|
|
<div className="stats__row">
|
|
|
|
<div className="stats__row-value mb-1">
|
2020-03-17 12:15:19 +00:00
|
|
|
<strong>{formatNumber(value)}</strong>
|
|
|
|
<small className="ml-3 text-muted">{percent}%</small>
|
2018-10-12 13:02:01 +00:00
|
|
|
</div>
|
|
|
|
<div className="progress progress-xs">
|
|
|
|
<div
|
|
|
|
className="progress-bar"
|
|
|
|
style={{
|
2020-03-17 12:15:19 +00:00
|
|
|
width: `${percent}%`,
|
|
|
|
backgroundColor: color,
|
2018-10-12 13:02:01 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
Cell.propTypes = {
|
|
|
|
value: PropTypes.number.isRequired,
|
|
|
|
percent: PropTypes.number.isRequired,
|
|
|
|
color: PropTypes.string.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Cell;
|