postInstallCodeSnippet.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {t} from 'sentry/locale';
  4. import type {IntegrationProvider, PlatformKey} from 'sentry/types';
  5. type Props = {
  6. provider: IntegrationProvider;
  7. isOnboarding?: boolean;
  8. platform?: PlatformKey;
  9. };
  10. export default function PostInstallCodeSnippet({
  11. provider,
  12. platform,
  13. isOnboarding,
  14. }: Props) {
  15. // currently supporting both Python and Node
  16. const token_punctuation: string = platform === 'python-awslambda' ? '()' : '();';
  17. return (
  18. <div>
  19. <p>
  20. {t(
  21. "Congrats, you just installed the %s integration! Now that it's is installed, the next time you trigger an error it will go to your Sentry.",
  22. provider.name
  23. )}
  24. </p>
  25. <p>
  26. {t(
  27. 'This snippet includes an intentional error, so you can test that everything is working as soon as you set it up:'
  28. )}
  29. </p>
  30. <div>
  31. <CodeWrapper>
  32. <code>
  33. <TokenFunction>myUndefinedFunction</TokenFunction>
  34. <TokenPunctuation>{token_punctuation}</TokenPunctuation>)
  35. </code>
  36. </CodeWrapper>
  37. </div>
  38. {isOnboarding && (
  39. <Fragment>
  40. <p>
  41. {t(
  42. "If you're new to Sentry, use the email alert to access your account and complete a product tour."
  43. )}
  44. </p>
  45. <p>
  46. {t(
  47. "If you're an existing user and have disabled alerts, you won't receive this email."
  48. )}
  49. </p>
  50. </Fragment>
  51. )}
  52. </div>
  53. );
  54. }
  55. const CodeWrapper = styled('pre')`
  56. padding: 1em;
  57. overflow: auto;
  58. background: #251f3d;
  59. font-size: 15px;
  60. `;
  61. const TokenFunction = styled('span')`
  62. color: #7cc5c4;
  63. `;
  64. const TokenPunctuation = styled('span')`
  65. color: #b3acc1;
  66. `;