monitorIssues.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import EmptyStateWarning from 'sentry/components/emptyStateWarning';
  2. import GroupList from 'sentry/components/issues/groupList';
  3. import {Panel, PanelBody} from 'sentry/components/panels';
  4. import {t} from 'sentry/locale';
  5. import {Monitor} from './types';
  6. type Props = {
  7. monitor: Monitor;
  8. orgId: string;
  9. };
  10. const MonitorIssuesEmptyMessage = () => (
  11. <Panel>
  12. <PanelBody>
  13. <EmptyStateWarning>
  14. <p>{t('No issues founds relating to this monitor')}</p>
  15. </EmptyStateWarning>
  16. </PanelBody>
  17. </Panel>
  18. );
  19. const MonitorIssues = ({orgId, monitor}: Props) => {
  20. return (
  21. <GroupList
  22. orgId={orgId}
  23. endpointPath={`/organizations/${orgId}/issues/`}
  24. queryParams={{
  25. query: `monitor.id:"${monitor.id}"`,
  26. project: monitor.project.id,
  27. limit: 5,
  28. }}
  29. query=""
  30. renderEmptyMessage={MonitorIssuesEmptyMessage}
  31. canSelectGroups={false}
  32. withPagination={false}
  33. withChart={false}
  34. useTintRow={false}
  35. source="monitors"
  36. />
  37. );
  38. };
  39. export default MonitorIssues;