import { cn } from "@/app/_utils/global-utils"; import { HTMLAttributes, forwardRef } from "react"; import { Activity } from "lucide-react"; import { useTranslations } from "next-intl"; export interface SystemStatusProps extends HTMLAttributes { status: string; details: string; timestamp: string; isUpdating?: boolean; } export const SystemStatus = forwardRef( ( { className, status, details, timestamp, isUpdating = false, ...props }, ref ) => { const t = useTranslations(); const getStatusConfig = (status: string) => { const lowerStatus = status.toLowerCase(); switch (lowerStatus) { case "operational": return { bgColor: "bg-emerald-500/10", borderColor: "border-emerald-500/20", dotColor: "bg-emerald-500", }; case "warning": return { bgColor: "bg-yellow-500/10", borderColor: "border-yellow-500/20", dotColor: "bg-yellow-500", }; case "critical": return { bgColor: "bg-destructive/10", borderColor: "border-destructive/20", dotColor: "bg-destructive", }; default: return { bgColor: "bg-muted", borderColor: "border-border", dotColor: "bg-muted-foreground", }; } }; const config = getStatusConfig(status); return (
{t("system.systemStatus")}: {status}

{details} • {t("system.lastUpdated")}: {timestamp} {isUpdating && 🔄}

); } ); SystemStatus.displayName = "SystemStatus";