groupEventDetailsLoadingError.tsx 1.3 KB

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