Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
990 B ยท 41 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142export const statusCodes = [ { code: 200 as const, bg: "bg-success", text: "text-success", name: "OK", }, { code: 500 as const, bg: "bg-destructive", text: "text-destructive", name: "Internal Server Error", },];
export type StatusCode = (typeof statusCodes)[number]["code"];
export const getStatusCodeVariant = (code?: number | null) => { if (!code) return "muted"; if (code.toString().startsWith("2")) return "success"; if (code.toString().startsWith("3")) return "info"; if (code.toString().startsWith("4")) return "warning"; if (code.toString().startsWith("5")) return "destructive"; return "muted";};
export const bgColors = { success: "bg-success", info: "bg-info", warning: "bg-warning", destructive: "bg-destructive", muted: "bg-muted",};
export const textColors = { success: "text-success", info: "text-info", warning: "text-warning", destructive: "text-destructive", muted: "text-muted-foreground",};