throughputCell.tsx 557 B

1234567891011121314151617181920
  1. import {RateUnits} from 'sentry/utils/discover/fields';
  2. import {NumberContainer} from 'sentry/utils/discover/styles';
  3. import {formatRate} from 'sentry/utils/formatters';
  4. type Props = {
  5. unit: RateUnits;
  6. containerProps?: React.DetailedHTMLProps<
  7. React.HTMLAttributes<HTMLDivElement>,
  8. HTMLDivElement
  9. >;
  10. rate?: number;
  11. };
  12. export function ThroughputCell({rate, unit, containerProps}: Props) {
  13. return (
  14. <NumberContainer {...containerProps}>
  15. {rate ? formatRate(rate, unit, {minimumValue: 0.001}) : '--'}
  16. </NumberContainer>
  17. );
  18. }