constants.tsx 1.2 KB

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