constants.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import {
  2. IconCheckmark,
  3. IconFire,
  4. IconTimer,
  5. IconUnsubscribed,
  6. IconWarning,
  7. } from 'sentry/icons';
  8. import {Aliases} from 'sentry/utils/theme';
  9. import {StatsBucket} from 'sentry/views/monitors/components/overviewTimeline/types';
  10. import {CheckInStatus, MonitorStatus} from 'sentry/views/monitors/types';
  11. // Orders the status in terms of precedence for showing to the user
  12. export const CHECKIN_STATUS_PRECEDENT = [
  13. CheckInStatus.OK,
  14. CheckInStatus.MISSED,
  15. CheckInStatus.TIMEOUT,
  16. CheckInStatus.ERROR,
  17. ] satisfies Array<keyof StatsBucket>;
  18. export const statusIconColorMap: Record<
  19. MonitorStatus,
  20. {color: keyof Aliases; icon: React.ReactNode}
  21. > = {
  22. ok: {
  23. icon: <IconCheckmark color="successText" />,
  24. color: 'successText',
  25. },
  26. error: {
  27. icon: <IconFire color="errorText" />,
  28. color: 'errorText',
  29. },
  30. timeout: {
  31. icon: <IconFire color="errorText" />,
  32. color: 'errorText',
  33. },
  34. missed_checkin: {
  35. icon: <IconWarning color="warningText" />,
  36. color: 'warningText',
  37. },
  38. active: {
  39. icon: <IconTimer color="subText" />,
  40. color: 'subText',
  41. },
  42. disabled: {
  43. icon: <IconUnsubscribed color="subText" size="xs" />,
  44. color: 'subText',
  45. },
  46. };