throughputCell.tsx 628 B

123456789101112131415161718192021
  1. import {t} from 'sentry/locale';
  2. import {NumberContainer} from 'sentry/utils/discover/styles';
  3. import {formatAbbreviatedNumber} from 'sentry/utils/formatters';
  4. type Props = {
  5. containerProps?: React.DetailedHTMLProps<
  6. React.HTMLAttributes<HTMLDivElement>,
  7. HTMLDivElement
  8. >;
  9. throughputPerSecond?: number;
  10. };
  11. export default function ThroughputCell({throughputPerSecond, containerProps}: Props) {
  12. const throughput = throughputPerSecond ? throughputPerSecond.toFixed(2) : '--';
  13. return (
  14. <NumberContainer {...containerProps}>
  15. {formatAbbreviatedNumber(throughput)}/{t('s')}
  16. </NumberContainer>
  17. );
  18. }