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