import React from 'react';
import PropTypes from 'prop-types';
import { Label } from 'react-bootstrap';
import { t } from '../../locales';
import { defaultNumberFormatter } from '../../modules/utils';
import TooltipWrapper from '../../components/TooltipWrapper';
const propTypes = {
rowcount: PropTypes.number,
limit: PropTypes.number,
};
const defaultProps = {
};
export default function RowCountLabel({ rowcount, limit }) {
const limitReached = rowcount === limit;
const bsStyle = (limitReached || rowcount === 0) ? 'warning' : 'default';
const formattedRowCount = defaultNumberFormatter(rowcount);
const tooltip = (
{limitReached &&
{t('Limit reached')}
}
{rowcount}
);
return (
);
}
RowCountLabel.propTypes = propTypes;
RowCountLabel.defaultProps = defaultProps;