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