QueryInsightsHealth.utils.ts 332 B

12345678
  1. import { HEALTH_LEVELS } from './QueryInsightsHealth.constants'
  2. import type { HealthLevel } from './QueryInsightsHealth.types'
  3. export const getHealthLevel = (score: number): HealthLevel => {
  4. if (score >= HEALTH_LEVELS.healthy.min) return 'healthy'
  5. if (score >= HEALTH_LEVELS.warning.min) return 'warning'
  6. return 'critical'
  7. }