Derive domain status from subscription status and add backfill

This commit is contained in:
2026-03-05 10:01:08 +00:00
parent 09d66ea601
commit 3599ccbb39
3 changed files with 53 additions and 12 deletions

View File

@@ -52,11 +52,19 @@ type Props = {
function getDomainStatusBadge(status: string | null) {
const normalized = (status ?? "unknown").toLowerCase();
if (normalized === "active") return "bg-emerald-100 text-emerald-700";
if (
normalized.includes("active") ||
normalized.includes("ok") ||
normalized.includes("enabled")
) {
return "bg-emerald-100 text-emerald-700";
}
if (normalized === "suspended") return "bg-rose-100 text-rose-700";
if (normalized.includes("suspended") || normalized.includes("disabled")) {
return "bg-rose-100 text-rose-700";
}
if (normalized === "inactive") return "bg-amber-100 text-amber-700";
if (normalized.includes("inactive")) return "bg-amber-100 text-amber-700";
return "bg-slate-100 text-slate-600";
}