transactionSummaryTabs.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import FeatureBadge from 'sentry/components/featureBadge';
  2. import ReplayCountBadge from 'sentry/components/replays/replayCountBadge';
  3. import ReplaysFeatureBadge from 'sentry/components/replays/replaysFeatureBadge';
  4. import {TabList} from 'sentry/components/tabs';
  5. import {t} from 'sentry/locale';
  6. import Tab from './tabs';
  7. type Props = {
  8. hasAnomalyDetection: boolean;
  9. hasProfiling: boolean;
  10. hasSessionReplay: boolean;
  11. renderWebVitals: boolean;
  12. replaysCount: undefined | number;
  13. };
  14. function TransactionSummaryTabs({
  15. hasAnomalyDetection,
  16. hasProfiling,
  17. hasSessionReplay,
  18. renderWebVitals,
  19. replaysCount,
  20. }: Props) {
  21. return (
  22. <TabList
  23. hideBorder
  24. outerWrapStyles={{
  25. gridColumn: '1 / -1',
  26. }}
  27. >
  28. <TabList.Item key={Tab.TransactionSummary}>{t('Overview')}</TabList.Item>
  29. <TabList.Item key={Tab.Events}>{t('All Events')}</TabList.Item>
  30. <TabList.Item key={Tab.Tags}>{t('Tags')}</TabList.Item>
  31. <TabList.Item key={Tab.Spans}>{t('Spans')}</TabList.Item>
  32. <TabList.Item key={Tab.Anomalies} hidden={!hasAnomalyDetection}>
  33. {t('Anomalies')}
  34. <FeatureBadge type="alpha" noTooltip />
  35. </TabList.Item>
  36. <TabList.Item key={Tab.WebVitals} hidden={!renderWebVitals}>
  37. {t('Web Vitals')}
  38. </TabList.Item>
  39. <TabList.Item key={Tab.Replays} hidden={!hasSessionReplay}>
  40. {t('Replays')}
  41. <ReplayCountBadge count={replaysCount} />
  42. <ReplaysFeatureBadge noTooltip />
  43. </TabList.Item>
  44. <TabList.Item key={Tab.Profiling} hidden={!hasProfiling}>
  45. {t('Profiling')}
  46. <FeatureBadge type="beta" noTooltip />
  47. </TabList.Item>
  48. </TabList>
  49. );
  50. }
  51. export default TransactionSummaryTabs;