index.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import {Fragment} from 'react';
  2. import type {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 type {OrganizationSummary} from 'sentry/types';
  7. import type {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. queryExtras?: Record<string, string>;
  15. totalCount?: number | null;
  16. };
  17. function LatencyChart({currentFilter, ...props}: Props) {
  18. const header = (
  19. <HeaderTitleLegend>
  20. {currentFilter === SpanOperationBreakdownFilter.NONE
  21. ? t('Duration Distribution')
  22. : tct('Span Operation Distribution - [operationName]', {
  23. operationName: currentFilter,
  24. })}
  25. <QuestionTooltip
  26. position="top"
  27. size="sm"
  28. title={t(
  29. `Duration Distribution reflects the volume of transactions per median duration.`
  30. )}
  31. />
  32. </HeaderTitleLegend>
  33. );
  34. return (
  35. <Fragment>
  36. {header}
  37. <Content {...props} currentFilter={currentFilter} />
  38. </Fragment>
  39. );
  40. }
  41. export default LatencyChart;