sidebarDropdownMenu.tsx 919 B

12345678910111213141516171819202122232425262728293031
  1. import {Fragment} from 'react';
  2. import SidebarMenuItem from 'sentry/components/sidebar/sidebarMenuItem';
  3. import {t} from 'sentry/locale';
  4. import type {Organization} from 'sentry/types/organization';
  5. type Props = {
  6. organization: Organization;
  7. };
  8. /**
  9. * Hook for sidebar root dropdown menu to display Usage & Billing and Support
  10. * links
  11. */
  12. export default function sidebarDropdownMenu(props: Props) {
  13. const {organization} = props;
  14. const hasBillingAccess = organization.access?.indexOf('org:billing') > -1;
  15. return (
  16. <Fragment key="sidebar:organization-dropdown-menu">
  17. {hasBillingAccess && (
  18. <SidebarMenuItem key="billing" to={`/settings/${organization.slug}/billing/`}>
  19. {t('Usage & Billing')}
  20. </SidebarMenuItem>
  21. )}
  22. <SidebarMenuItem key="support" href="https://sentry.zendesk.com/hc/en-us">
  23. {t('Support')}
  24. </SidebarMenuItem>
  25. </Fragment>
  26. );
  27. }