throughputCell.tsx 542 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 default function ThroughputCell({rate, unit, containerProps}: Props) {
  13. return (
  14. <NumberContainer {...containerProps}>
  15. {rate ? formatRate(rate, unit) : '--'}
  16. </NumberContainer>
  17. );
  18. }