Files
supabase/apps/studio/components/interfaces/QueryInsights/QueryInsightsHealth/QueryInsightsHealth.utils.ts
kemal.earth 7ed8ab83a8 feat(studio): query insights improvements (#43109)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

This introduces Query Insights. It's the first edition of possible
future updates. This takes our old prototype and builds upon it for a
more action driven insights view.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-03-13 15:09:26 +00:00

9 lines
332 B
TypeScript

import { HEALTH_LEVELS } from './QueryInsightsHealth.constants'
import type { HealthLevel } from './QueryInsightsHealth.types'
export const getHealthLevel = (score: number): HealthLevel => {
if (score >= HEALTH_LEVELS.healthy.min) return 'healthy'
if (score >= HEALTH_LEVELS.warning.min) return 'warning'
return 'critical'
}