"use client"; import { AlertTriangle, GaugeCircle, ShieldCheck, ThermometerSun } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import type { Locale } from "@/lib/i18n"; import { cn } from "@/lib/utils"; import type { CitySummary } from "@/lib/types"; type CityListProps = { cities: CitySummary[]; selectedCity: string | null; onSelectCity: (cityName: string) => void; locale: Locale; text: { monitoredCities: string; high: string; medium: string; low: string; fahrenheit: string; celsius: string; }; }; function riskVariant(level: CitySummary["risk_level"]): "success" | "warning" | "danger" { if (level === "high") return "danger"; if (level === "medium") return "warning"; return "success"; } export function CityList({ cities, selectedCity, onSelectCity, locale, text, }: CityListProps) { const high = cities.filter((c) => c.risk_level === "high").length; const medium = cities.filter((c) => c.risk_level === "medium").length; const low = cities.filter((c) => c.risk_level === "low").length; return ( {text.monitoredCities} {cities.length}
{text.high}

{high}

{text.medium}

{medium}

{text.low}

{low}

{cities.map((city) => ( ))}
); }