twoFactorRequired.tsx 850 B

1234567891011121314151617181920212223242526
  1. import styled from '@emotion/styled';
  2. import Alert from 'sentry/components/alert';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {tct} from 'sentry/locale';
  5. import space from 'sentry/styles/space';
  6. import getPendingInvite from 'sentry/utils/getPendingInvite';
  7. const TwoFactorRequired = () =>
  8. !getPendingInvite() ? null : (
  9. <StyledAlert data-test-id="require-2fa" type="error" showIcon>
  10. {tct(
  11. 'You have been invited to an organization that requires [link:two-factor authentication].' +
  12. ' Setup two-factor authentication below to join your organization.',
  13. {
  14. link: <ExternalLink href="https://docs.sentry.io/accounts/require-2fa/" />,
  15. }
  16. )}
  17. </StyledAlert>
  18. );
  19. const StyledAlert = styled(Alert)`
  20. margin: ${space(3)} 0;
  21. `;
  22. export default TwoFactorRequired;