constants.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 ascending precedence for showing to the user
  12. export const CHECKIN_STATUS_PRECEDENT = [
  13. CheckInStatus.IN_PROGRESS,
  14. CheckInStatus.OK,
  15. CheckInStatus.MISSED,
  16. CheckInStatus.TIMEOUT,
  17. CheckInStatus.ERROR,
  18. ] satisfies Array<keyof StatsBucket>;
  19. export const statusIconColorMap: Record<
  20. MonitorStatus,
  21. {color: keyof Aliases; icon: React.ReactNode}
  22. > = {
  23. ok: {
  24. icon: <IconCheckmark color="successText" />,
  25. color: 'successText',
  26. },
  27. error: {
  28. icon: <IconFire color="errorText" />,
  29. color: 'errorText',
  30. },
  31. timeout: {
  32. icon: <IconFire color="errorText" />,
  33. color: 'errorText',
  34. },
  35. missed_checkin: {
  36. icon: <IconWarning color="warningText" />,
  37. color: 'warningText',
  38. },
  39. active: {
  40. icon: <IconTimer color="subText" />,
  41. color: 'subText',
  42. },
  43. disabled: {
  44. icon: <IconUnsubscribed color="subText" size="xs" />,
  45. color: 'subText',
  46. },
  47. };