Files
talk/client/coral-admin/src/components/CountBadge.js
T
2018-06-01 15:13:58 -06:00

20 lines
462 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import styles from './CountBadge.css';
import { humanizeNumber } from 'coral-framework/helpers/numbers';
const CountBadge = ({ count }) => {
let number = count;
// shorten large counts to abbreviations
number = humanizeNumber(number);
return <span className={styles.count}>{number}</span>;
};
CountBadge.propTypes = {
count: PropTypes.number.isRequired,
};
export default CountBadge;