throughputCell.tsx 625 B

1234567891011121314151617181920212223
  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
  13. ? formatAbbreviatedNumber(throughputPerSecond)
  14. : '--';
  15. return (
  16. <NumberContainer {...containerProps}>
  17. {throughput}/{t('s')}
  18. </NumberContainer>
  19. );
  20. }