Derive domain status from subscription status and add backfill
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user