Files
homelab-optimized/dashboard/ui/components/status-badge.tsx
Gitea Mirror Bot 2be8f1fe17
Some checks failed
Documentation / Build Docusaurus (push) Failing after 5m1s
Documentation / Deploy to GitHub Pages (push) Has been skipped
Sanitized mirror from private repository - 2026-04-05 08:31:50 UTC
2026-04-05 08:31:50 +00:00

29 lines
735 B
TypeScript

import { cn } from "@/lib/utils";
const colorMap: Record<string, string> = {
green: "bg-green-500 glow-green",
red: "bg-red-500 glow-red",
amber: "bg-amber-500 glow-amber",
blue: "bg-blue-500 glow-blue",
purple: "bg-purple-500 glow-purple",
};
interface StatusBadgeProps {
color: "green" | "red" | "amber" | "blue" | "purple";
label?: string;
}
export function StatusBadge({ color, label }: StatusBadgeProps) {
return (
<span className="inline-flex items-center gap-1.5 text-xs">
<span
className={cn(
"w-2 h-2 rounded-full shrink-0",
colorMap[color] ?? "bg-gray-500"
)}
/>
{label && <span className="text-muted-foreground">{label}</span>}
</span>
);
}