Update health-status-modal.tsx

This commit is contained in:
MacRimi
2026-08-16 11:09:50 +02:00
parent ec129b8262
commit b577c154ee
+8 -15
View File
@@ -279,21 +279,14 @@ export function HealthStatusModal({ open, onOpenChange, getApiUrl }: HealthStatu
} }
const getStatusBadge = (status: string) => { const getStatusBadge = (status: string) => {
const statusUpper = status?.toUpperCase() const s = status?.toUpperCase()
switch (statusUpper) { const label =
case "OK": s === "OK" ? t("healthStatus.status.ok") :
return <Badge className="bg-green-500 text-white hover:bg-green-500">{t("healthStatus.status.ok")}</Badge> s === "INFO" ? t("healthStatus.status.info") :
case "INFO": s === "WARNING" ? t("healthStatus.status.warning") :
return <Badge className="bg-blue-500 text-white hover:bg-blue-500">{t("healthStatus.status.info")}</Badge> s === "CRITICAL" ? t("healthStatus.status.critical") :
case "WARNING": t("healthStatus.status.unknown")
return <Badge className="bg-yellow-500 text-white hover:bg-yellow-500">{t("healthStatus.status.warning")}</Badge> return <Badge variant="outline" className={getOutlineBadgeStyle(status)}>{label}</Badge>
case "CRITICAL":
return <Badge className="bg-red-500 text-white hover:bg-red-500">{t("healthStatus.status.critical")}</Badge>
case "UNKNOWN":
return <Badge className="bg-amber-500 text-white hover:bg-amber-500">{t("healthStatus.status.unknown")}</Badge>
default:
return <Badge>{t("healthStatus.status.unknown")}</Badge>
}
} }
const formatStatus = (status: string) => { const formatStatus = (status: string) => {