QueryInsightsHealth.utils.ts8 lines · main
| 1 | import { HEALTH_LEVELS } from './QueryInsightsHealth.constants' |
| 2 | import type { HealthLevel } from './QueryInsightsHealth.types' |
| 3 | |
| 4 | export 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 | } |