firstEventFooter.tsx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {Button} from 'sentry/components/button';
  4. import ButtonBar from 'sentry/components/buttonBar';
  5. import {t, tct} from 'sentry/locale';
  6. import {space} from 'sentry/styles/space';
  7. import type {Organization, Project} from 'sentry/types';
  8. import FirstEventIndicator from 'sentry/views/onboarding/components/firstEventIndicator';
  9. import CreateSampleEventButton from 'sentry/views/onboarding/createSampleEventButton';
  10. interface FirstEventFooterProps {
  11. organization: Organization;
  12. project: Project;
  13. docsLink?: string;
  14. docsOnClick?: () => void;
  15. }
  16. export default function FirstEventFooter({
  17. organization,
  18. project,
  19. docsLink,
  20. docsOnClick,
  21. }: FirstEventFooterProps) {
  22. return (
  23. <Fragment>
  24. <FirstEventIndicator
  25. organization={organization}
  26. project={project}
  27. eventType="error"
  28. >
  29. {({indicator, firstEventButton}) => (
  30. <CTAFooter>
  31. <Actions gap={2}>
  32. {firstEventButton}
  33. <Button external href={docsLink} onClick={docsOnClick}>
  34. {t('View full documentation')}
  35. </Button>
  36. </Actions>
  37. {indicator}
  38. </CTAFooter>
  39. )}
  40. </FirstEventIndicator>
  41. <CTASecondary>
  42. {tct(
  43. 'Just want to poke around before getting too cozy with the SDK? [sample:View a sample event for this SDK] or [skip:finish setup later].',
  44. {
  45. sample: (
  46. <CreateSampleEventButton
  47. aria-label="View a sample event"
  48. project={project}
  49. source="onboarding"
  50. priority="link"
  51. />
  52. ),
  53. skip: (
  54. <Button priority="link" href="/" aria-label={t('Finish setup later')} />
  55. ),
  56. }
  57. )}
  58. </CTASecondary>
  59. </Fragment>
  60. );
  61. }
  62. const CTAFooter = styled('div')`
  63. display: flex;
  64. justify-content: space-between;
  65. margin: ${space(2)} 0;
  66. margin-top: ${space(4)};
  67. `;
  68. const CTASecondary = styled('p')`
  69. color: ${p => p.theme.subText};
  70. font-size: ${p => p.theme.fontSizeMedium};
  71. margin: 0;
  72. max-width: 500px;
  73. `;
  74. const Actions = styled(ButtonBar)`
  75. display: inline-grid;
  76. justify-self: start;
  77. `;