index.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import {Fragment} from 'react';
  2. import {Location} from 'history';
  3. import {HeaderTitleLegend} from 'sentry/components/charts/styles';
  4. import QuestionTooltip from 'sentry/components/questionTooltip';
  5. import {t, tct} from 'sentry/locale';
  6. import {OrganizationSummary} from 'sentry/types';
  7. import {ViewProps} from '../../../types';
  8. import {SpanOperationBreakdownFilter} from '../../filter';
  9. import Content from './content';
  10. type Props = ViewProps & {
  11. currentFilter: SpanOperationBreakdownFilter;
  12. location: Location;
  13. organization: OrganizationSummary;
  14. };
  15. function LatencyChart({currentFilter, ...props}: Props) {
  16. const header = (
  17. <HeaderTitleLegend>
  18. {currentFilter === SpanOperationBreakdownFilter.None
  19. ? t('Duration Distribution')
  20. : tct('Span Operation Distribution - [operationName]', {
  21. operationName: currentFilter,
  22. })}
  23. <QuestionTooltip
  24. position="top"
  25. size="sm"
  26. title={t(
  27. `Duration Distribution reflects the volume of transactions per median duration.`
  28. )}
  29. />
  30. </HeaderTitleLegend>
  31. );
  32. return (
  33. <Fragment>
  34. {header}
  35. <Content {...props} currentFilter={currentFilter} />
  36. </Fragment>
  37. );
  38. }
  39. export default LatencyChart;