noIssuesMatched.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import styled from '@emotion/styled';
  2. import campingImg from 'sentry-images/spot/onboarding-preview.svg';
  3. import {navigateTo} from 'sentry/actionCreators/navigation';
  4. import ExternalLink from 'sentry/components/links/externalLink';
  5. import {t, tct} from 'sentry/locale';
  6. import {space} from 'sentry/styles/space';
  7. import useOrganization from 'sentry/utils/useOrganization';
  8. import useRouter from 'sentry/utils/useRouter';
  9. function NoIssuesMatched() {
  10. const organization = useOrganization();
  11. const router = useRouter();
  12. return (
  13. <Wrapper data-test-id="empty-state" className="empty-state">
  14. <img src={campingImg} alt="Camping spot illustration" height={200} />
  15. <MessageContainer>
  16. <h3>{t('No issues match your search')}</h3>
  17. <div>{t('If this is unexpected, check out these tips:')}</div>
  18. <Tips>
  19. <li>{t('Double check your project, environment, and date filters')}</li>
  20. <li>
  21. {tct('Make sure your search has the right syntax. [link]', {
  22. link: (
  23. <ExternalLink href="https://docs.sentry.io/product/reference/search/">
  24. {t('Learn more')}
  25. </ExternalLink>
  26. ),
  27. })}
  28. </li>
  29. <li>
  30. {tct(
  31. "Check your [filterSettings: inbound data filters] to make sure the events aren't being filtered out",
  32. {
  33. filterSettings: (
  34. <a
  35. href="#"
  36. onClick={event => {
  37. event.preventDefault();
  38. const url = `/settings/${organization.slug}/projects/:projectId/filters/data-filters/`;
  39. if (router) {
  40. navigateTo(url, router);
  41. }
  42. }}
  43. />
  44. ),
  45. }
  46. )}
  47. </li>
  48. </Tips>
  49. </MessageContainer>
  50. </Wrapper>
  51. );
  52. }
  53. export default NoIssuesMatched;
  54. const Wrapper = styled('div')`
  55. display: flex;
  56. justify-content: center;
  57. font-size: ${p => p.theme.fontSizeLarge};
  58. border-radius: 0 0 3px 3px;
  59. padding: 40px ${space(3)};
  60. min-height: 260px;
  61. @media (max-width: ${p => p.theme.breakpoints.small}) {
  62. flex-direction: column;
  63. align-items: center;
  64. padding: ${space(3)};
  65. text-align: center;
  66. }
  67. `;
  68. const MessageContainer = styled('div')`
  69. align-self: center;
  70. max-width: 480px;
  71. margin-left: 40px;
  72. @media (max-width: ${p => p.theme.breakpoints.small}) {
  73. margin: 0;
  74. }
  75. `;
  76. const Tips = styled('ul')`
  77. text-align: left;
  78. `;