sampleEventAlert.tsx 1.3 KB

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