header.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {FeatureFeedback} from 'sentry/components/featureFeedback';
  2. import * as Layout from 'sentry/components/layouts/thirds';
  3. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  4. import {TabList} from 'sentry/components/tabs';
  5. import {t} from 'sentry/locale';
  6. import type {Organization} from 'sentry/types/organization';
  7. import normalizeUrl from 'sentry/utils/url/normalizeUrl';
  8. type Props = {
  9. activeTab: 'stats' | 'issues' | 'health';
  10. organization: Organization;
  11. };
  12. function StatsHeader({organization, activeTab}: Props) {
  13. return (
  14. <Layout.Header>
  15. <Layout.HeaderContent>
  16. <Layout.Title>
  17. {t('Stats')}
  18. <PageHeadingQuestionTooltip
  19. docsUrl="https://docs.sentry.io/product/stats/"
  20. title={t(
  21. 'A view of the usage data that Sentry has received across your entire organization.'
  22. )}
  23. />
  24. </Layout.Title>
  25. </Layout.HeaderContent>
  26. <Layout.HeaderActions>
  27. {activeTab !== 'stats' && (
  28. <FeatureFeedback buttonProps={{size: 'sm'}} featureName="team-stats" />
  29. )}
  30. </Layout.HeaderActions>
  31. <Layout.HeaderTabs value={activeTab}>
  32. <TabList hideBorder>
  33. <TabList.Item
  34. key="stats"
  35. to={normalizeUrl(`/organizations/${organization.slug}/stats/`)}
  36. >
  37. {t('Usage')}
  38. </TabList.Item>
  39. <TabList.Item
  40. key="issues"
  41. to={normalizeUrl(`/organizations/${organization.slug}/stats/issues/`)}
  42. >
  43. {t('Issues')}
  44. </TabList.Item>
  45. <TabList.Item
  46. key="health"
  47. to={normalizeUrl(`/organizations/${organization.slug}/stats/health/`)}
  48. >
  49. {t('Health')}
  50. </TabList.Item>
  51. </TabList>
  52. </Layout.HeaderTabs>
  53. </Layout.Header>
  54. );
  55. }
  56. export default StatsHeader;