timelineConfig.tsx 918 B

1234567891011121314151617181920212223242526272829303132
  1. import type {TickStyle} from 'sentry/components/checkInTimeline/types';
  2. import {t} from 'sentry/locale';
  3. import {CheckStatus} from 'sentry/views/alerts/rules/uptime/types';
  4. // Orders the status in terms of ascending precedence for showing to the user
  5. export const checkStatusPrecedent: CheckStatus[] = [
  6. CheckStatus.FAILURE,
  7. CheckStatus.MISSED_WINDOW,
  8. CheckStatus.SUCCESS,
  9. ];
  10. export const statusToText: Record<CheckStatus, string> = {
  11. [CheckStatus.SUCCESS]: t('Success'),
  12. [CheckStatus.FAILURE]: t('Failed'),
  13. [CheckStatus.MISSED_WINDOW]: t('Unknown'),
  14. };
  15. export const tickStyle: Record<CheckStatus, TickStyle> = {
  16. [CheckStatus.SUCCESS]: {
  17. labelColor: 'green400',
  18. tickColor: 'green300',
  19. },
  20. [CheckStatus.FAILURE]: {
  21. labelColor: 'red400',
  22. tickColor: 'red300',
  23. },
  24. [CheckStatus.MISSED_WINDOW]: {
  25. labelColor: 'gray400',
  26. tickColor: 'gray300',
  27. hatchTick: 'gray200',
  28. },
  29. };