header.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import styled from '@emotion/styled';
  2. import {FeatureFeedback} from 'sentry/components/featureFeedback';
  3. import * as Layout from 'sentry/components/layouts/thirds';
  4. import Link from 'sentry/components/links/link';
  5. import {t} from 'sentry/locale';
  6. import space from 'sentry/styles/space';
  7. import {Organization} from 'sentry/types';
  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. <StyledLayoutTitle>{t('Stats')}</StyledLayoutTitle>
  17. </Layout.HeaderContent>
  18. <Layout.HeaderActions>
  19. {activeTab !== 'stats' && <FeatureFeedback featureName="team-stats" />}
  20. </Layout.HeaderActions>
  21. <Layout.HeaderNavTabs underlined>
  22. <li className={`${activeTab === 'stats' ? 'active' : ''}`}>
  23. <Link to={`/organizations/${organization.slug}/stats/`}>{t('Usage')}</Link>
  24. </li>
  25. <li className={`${activeTab === 'issues' ? 'active' : ''}`}>
  26. <Link to={`/organizations/${organization.slug}/stats/issues/`}>
  27. {t('Issues')}
  28. </Link>
  29. </li>
  30. <li className={`${activeTab === 'health' ? 'active' : ''}`}>
  31. <Link to={`/organizations/${organization.slug}/stats/health/`}>
  32. {t('Health')}
  33. </Link>
  34. </li>
  35. </Layout.HeaderNavTabs>
  36. </Layout.Header>
  37. );
  38. }
  39. export default StatsHeader;
  40. const StyledLayoutTitle = styled(Layout.Title)`
  41. margin-top: ${space(0.5)};
  42. `;