header.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import styled from '@emotion/styled';
  2. import Button from 'sentry/components/button';
  3. import FeatureBadge from 'sentry/components/featureBadge';
  4. import * as Layout from 'sentry/components/layouts/thirds';
  5. import Link from 'sentry/components/links/link';
  6. import {t} from 'sentry/locale';
  7. import space from 'sentry/styles/space';
  8. import {Organization} from 'sentry/types';
  9. type Props = {
  10. organization: Organization;
  11. activeTab: 'stats' | 'issues' | 'health';
  12. };
  13. function StatsHeader({organization, activeTab}: Props) {
  14. return (
  15. <Layout.Header>
  16. <Layout.HeaderContent>
  17. <StyledLayoutTitle>{t('Stats')}</StyledLayoutTitle>
  18. </Layout.HeaderContent>
  19. <Layout.HeaderActions>
  20. {activeTab !== 'stats' && (
  21. <Button
  22. title={t('Send us feedback via email')}
  23. size="small"
  24. href="mailto:workflow-feedback@sentry.io?subject=Team Stats Feedback"
  25. >
  26. {t('Give Feedback')}
  27. </Button>
  28. )}
  29. </Layout.HeaderActions>
  30. <Layout.HeaderNavTabs underlined>
  31. <li className={`${activeTab === 'stats' ? 'active' : ''}`}>
  32. <Link to={`/organizations/${organization.slug}/stats/`}>
  33. {t('Usage Stats')}
  34. </Link>
  35. </li>
  36. <li className={`${activeTab === 'issues' ? 'active' : ''}`}>
  37. <Link to={`/organizations/${organization.slug}/stats/issues/`}>
  38. {t('Issues')}
  39. <FeatureBadge type="beta" />
  40. </Link>
  41. </li>
  42. <li className={`${activeTab === 'health' ? 'active' : ''}`}>
  43. <Link to={`/organizations/${organization.slug}/stats/health/`}>
  44. {t('Health')}
  45. <FeatureBadge type="beta" />
  46. </Link>
  47. </li>
  48. </Layout.HeaderNavTabs>
  49. </Layout.Header>
  50. );
  51. }
  52. export default StatsHeader;
  53. const StyledLayoutTitle = styled(Layout.Title)`
  54. margin-top: ${space(0.5)};
  55. `;