groupEventDetailsLoadingError.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import DetailedError from 'sentry/components/errors/detailedError';
  2. import List from 'sentry/components/list';
  3. import ListItem from 'sentry/components/list/listItem';
  4. import {t} from 'sentry/locale';
  5. import {Environment} from 'sentry/types';
  6. type Props = {
  7. environments: Environment[];
  8. onRetry?: (e: React.MouseEvent) => void;
  9. };
  10. const GroupEventDetailsLoadingError = ({onRetry, environments}: Props) => {
  11. const reasons = [
  12. t('The events are still processing and are on their way'),
  13. t('The events have been deleted'),
  14. t('There is an internal systems error or active issue'),
  15. ];
  16. let message: React.ReactNode;
  17. if (environments.length === 0) {
  18. // All Environments case
  19. message = (
  20. <div>
  21. <p>{t('This could be due to a handful of reasons:')}</p>
  22. <List symbol="bullet">
  23. {reasons.map((reason, i) => (
  24. <ListItem key={i}>{reason}</ListItem>
  25. ))}
  26. </List>
  27. </div>
  28. );
  29. } else {
  30. message = (
  31. <div>{t('No events were found for the currently selected environments')}</div>
  32. );
  33. }
  34. return (
  35. <DetailedError
  36. onRetry={environments.length === 0 ? onRetry : undefined}
  37. heading={t('Sorry, the events for this issue could not be found.')}
  38. message={message}
  39. />
  40. );
  41. };
  42. export default GroupEventDetailsLoadingError;