disabledDataForwarding.tsx 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import styled from '@emotion/styled';
  2. import {Button} from 'sentry/components/button';
  3. import EmptyMessage from 'sentry/components/emptyMessage';
  4. import Panel from 'sentry/components/panels/panel';
  5. import {IconArrow, 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 DisabledDataForwarding({organization, features}: Props) {
  18. return (
  19. <PlanFeature {...{organization, features}}>
  20. {({plan}) => (
  21. <Panel dashedBorder data-test-id="disabled-data-forwarding">
  22. <EmptyMessage
  23. size="large"
  24. icon={<IconArrow direction="right" size="xl" />}
  25. title={t('Your business intelligence workflow is missing crucial data')}
  26. description={
  27. plan !== null
  28. ? tct(
  29. '[strong:Data Forwarding] allows you to send processed events to your favorite business intelligence tools such as Segment, Amazon SQS, and Splunk. This feature [planRequirement] or above.',
  30. {
  31. strong: <strong />,
  32. planRequirement: (
  33. <strong>{t('requires a %s Plan', displayPlanName(plan))}</strong>
  34. ),
  35. }
  36. )
  37. : t(
  38. 'Data forwarding is not available on your plan. Contact us to migrate to a plan that supports sending your events for processing with your favorite business intelligence tools such as Segment, Amazon SQS, and Splunk.'
  39. )
  40. }
  41. action={
  42. <ButtonGroup>
  43. <Button
  44. priority="primary"
  45. icon={<IconBusiness />}
  46. onClick={() =>
  47. openUpsellModal({organization, source: 'feature.data_forwarding'})
  48. }
  49. >
  50. {t('Learn More')}
  51. </Button>
  52. <LearnMoreButton
  53. organization={organization}
  54. source="feature.data_forwarding"
  55. href="https://docs.sentry.io/product/data-management-settings/data-forwarding/"
  56. external
  57. >
  58. {t('Documentation')}
  59. </LearnMoreButton>
  60. </ButtonGroup>
  61. }
  62. />
  63. </Panel>
  64. )}
  65. </PlanFeature>
  66. );
  67. }
  68. const ButtonGroup = styled('div')`
  69. display: grid;
  70. grid-auto-flow: column;
  71. gap: ${space(1.5)};
  72. `;
  73. export default DisabledDataForwarding;