partnershipNote.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Panel from 'sentry/components/panels/panel';
  2. import PanelBody from 'sentry/components/panels/panelBody';
  3. import {tct} from 'sentry/locale';
  4. import TextBlock from 'sentry/views/settings/components/text/textBlock';
  5. import type {Subscription} from 'getsentry/types';
  6. const DEFAULT_MESSAGE = tct(
  7. 'Contact us at [mailto:support@sentry.io] to make changes to your subscription.',
  8. {mailto: <a href="mailto:support@sentry.io" />}
  9. );
  10. type Props = {
  11. subscription: Subscription;
  12. };
  13. function PartnershipNote({subscription}: Props) {
  14. return (
  15. <Panel data-test-id="partnership-note">
  16. <PanelBody withPadding>
  17. {subscription.partner ? (
  18. // usually we pass it through sentry.utils.marked but
  19. // markdown doesn't support adding attributes to links
  20. <TextBlock
  21. noMargin
  22. dangerouslySetInnerHTML={{
  23. __html: subscription.partner?.partnership.supportNote || '',
  24. }}
  25. />
  26. ) : (
  27. <TextBlock noMargin>{DEFAULT_MESSAGE}</TextBlock>
  28. )}
  29. </PanelBody>
  30. </Panel>
  31. );
  32. }
  33. export default PartnershipNote;