missingReplayAlert.tsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {Alert} from 'sentry/components/alert';
  4. import ExternalLink from 'sentry/components/links/externalLink';
  5. import Link from 'sentry/components/links/link';
  6. import List from 'sentry/components/list';
  7. import ListItem from 'sentry/components/list/listItem';
  8. import {t, tct} from 'sentry/locale';
  9. interface Props {
  10. orgSlug: string;
  11. }
  12. export default function MissingReplayAlert({orgSlug}: Props) {
  13. const reasons = [
  14. t('The replay is still processing.'),
  15. tct(
  16. 'The replay was rate-limited and could not be accepted. [link:View the stats page] for more information.',
  17. {
  18. link: <Link to={`/organizations/${orgSlug}/stats/?dataCategory=replays`} />,
  19. }
  20. ),
  21. t('The replay has been deleted by a member in your organization.'),
  22. t('There were network errors and the replay was not saved.'),
  23. ];
  24. return (
  25. <Alert
  26. type="info"
  27. showIcon
  28. data-test-id="replay-error"
  29. expand={
  30. <Fragment>
  31. <ListIntro>{t('Other reasons may include:')}</ListIntro>
  32. <List symbol="bullet">
  33. {reasons.map((reason, i) => (
  34. <ListItem key={i}>{reason}</ListItem>
  35. ))}
  36. </List>
  37. </Fragment>
  38. }
  39. >
  40. {tct(
  41. "The replay associated with this event cannot be found. In most cases, the replay wasn't accepted because your replay quota was exceeded at the time. To learn more, [link:read our docs].",
  42. {
  43. link: (
  44. <ExternalLink href="https://docs.sentry.io/platforms/javascript/session-replay/#error-linking" />
  45. ),
  46. }
  47. )}
  48. </Alert>
  49. );
  50. }
  51. const ListIntro = styled('div')`
  52. line-height: 2em;
  53. `;