import PropTypes from 'prop-types';
import React from 'react';
-const CountDisplay = ({ className, count }) => {
+const CountDisplay = ({ className, count, full }) => {
const classNames = ['count-display'];
if (className) {
classNames.push(className);
if (!count) {
classNames.push('is-zero');
}
- return <span className={classNames.join(' ')}>
+ if (full && count >= full) {
+ classNames.push('is-full');
+ }
+ return <text className={classNames.join(' ')}>
{count}
- </span>;
+ </text>;
};
CountDisplay.propTypes = {
className: PropTypes.string,
count: PropTypes.number,
+ full: PropTypes.number,
};
export default CountDisplay;