sampleEventAlert.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import styled from '@emotion/styled';
  2. import {LinkButton} from 'sentry/components/button';
  3. import PageAlertBar from 'sentry/components/pageAlertBar';
  4. import {IconLightning} from 'sentry/icons';
  5. import {t} from 'sentry/locale';
  6. import {space} from 'sentry/styles/space';
  7. import type {Organization} from 'sentry/types/organization';
  8. import type {AvatarProject} from 'sentry/types/project';
  9. import {trackAnalytics} from 'sentry/utils/analytics';
  10. function SampleEventAlert({
  11. organization,
  12. project,
  13. }: {
  14. organization: Organization;
  15. project: AvatarProject;
  16. }) {
  17. return (
  18. <PageAlertBar>
  19. <IconLightning />
  20. <TextWrapper>
  21. {t(
  22. 'You are viewing a sample error. Configure Sentry to start viewing real errors.'
  23. )}
  24. </TextWrapper>
  25. <LinkButton
  26. size="xs"
  27. priority="primary"
  28. to={`/${organization.slug}/${project.slug}/getting-started/${
  29. project.platform || ''
  30. }`}
  31. onClick={() =>
  32. trackAnalytics('growth.sample_error_onboarding_link_clicked', {
  33. project_id: project.id?.toString(),
  34. organization,
  35. platform: project.platform,
  36. })
  37. }
  38. >
  39. {t('Get Started')}
  40. </LinkButton>
  41. </PageAlertBar>
  42. );
  43. }
  44. export default SampleEventAlert;
  45. const TextWrapper = styled('span')`
  46. margin: 0 ${space(1)};
  47. `;