constants.tsx 1.1 KB

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