disabledRelay.tsx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import styled from '@emotion/styled';
  2. import {Button, ButtonLabel} from 'sentry/components/button';
  3. import EmptyMessage from 'sentry/components/emptyMessage';
  4. import Panel from 'sentry/components/panels/panel';
  5. import {IconBroadcast, IconBusiness} from 'sentry/icons';
  6. import {t, tct} from 'sentry/locale';
  7. import {space} from 'sentry/styles/space';
  8. import type {Organization} from 'sentry/types/organization';
  9. import {openUpsellModal} from 'getsentry/actionCreators/modal';
  10. import LearnMoreButton from 'getsentry/components/features/learnMoreButton';
  11. import PlanFeature from 'getsentry/components/features/planFeature';
  12. import {displayPlanName} from 'getsentry/utils/billing';
  13. type Props = {
  14. features: string[];
  15. organization: Organization;
  16. };
  17. function DisabledRelay({organization, features}: Props) {
  18. return (
  19. <PlanFeature {...{organization, features}}>
  20. {({plan}) => (
  21. <Panel dashedBorder data-test-id="disabled-relay">
  22. <EmptyMessage
  23. size="large"
  24. icon={<IconBroadcast size="xl" />}
  25. title={t('Protect your private data and more by running a local Relay')}
  26. description={tct(
  27. '[strong: Sentry Relay] offers enterprise-grade data security by providing a standalone service that acts as a middle layer between your application and sentry.io. This feature [planRequirement] or above.',
  28. {
  29. strong: <strong />,
  30. planRequirement: (
  31. <strong>{t('requires a %s Plan', displayPlanName(plan))}</strong>
  32. ),
  33. }
  34. )}
  35. action={
  36. <ButtonBar>
  37. <StyledButton
  38. priority="primary"
  39. icon={<IconBusiness />}
  40. onClick={() => openUpsellModal({organization, source: 'feature.relay'})}
  41. >
  42. {t('Learn More')}
  43. </StyledButton>
  44. <StyledLearnMoreButton
  45. organization={organization}
  46. source="feature.relay"
  47. href="https://docs.sentry.io/product/relay/"
  48. external
  49. >
  50. {t('Documentation')}
  51. </StyledLearnMoreButton>
  52. </ButtonBar>
  53. }
  54. />
  55. </Panel>
  56. )}
  57. </PlanFeature>
  58. );
  59. }
  60. export default DisabledRelay;
  61. const ButtonBar = styled('div')`
  62. display: flex;
  63. flex-wrap: wrap;
  64. justify-content: center;
  65. align-items: center;
  66. margin: -${space(0.75)};
  67. ${ButtonLabel} {
  68. white-space: nowrap;
  69. }
  70. `;
  71. const StyledButton = styled(Button)`
  72. margin: ${space(0.75)};
  73. `;
  74. const StyledLearnMoreButton = styled(LearnMoreButton)`
  75. margin: ${space(0.75)};
  76. `;