MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / getAqiLabel

Function getAqiLabel

src/components/FieldDetailView.tsx:124–131  ·  view source on GitHub ↗
(aqi: number)

Source from the content-addressed store, hash-verified

122}
123
124function getAqiLabel(aqi: number): { label: string; color: string } {
125 if (aqi <= 20) return { label: "Good", color: "#7BC75B" };
126 if (aqi <= 40) return { label: "Fair", color: "#CDDC39" };
127 if (aqi <= 60) return { label: "Moderate", color: "#C6B77E" };
128 if (aqi <= 80) return { label: "Poor", color: "#FF9800" };
129 if (aqi <= 100) return { label: "Very Poor", color: "#d73027" };
130 return { label: "Hazardous", color: "#7B1FA2" };
131}
132
133function waterStressLabel(soilMoisture: number | null, rainfall: number | null): { label: string; color: string; detail: string } {
134 if (soilMoisture == null) return { label: "Checking…", color: "hsl(150, 10%, 55%)", detail: "Waiting for soil moisture data" };

Callers 1

FieldDetailViewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected