Files
homelab-optimized/dashboard/ui/components/status-badge.tsx
Gitea Mirror Bot 27d742a147
Some checks failed
Documentation / Build Docusaurus (push) Failing after 5m2s
Documentation / Deploy to GitHub Pages (push) Has been skipped
Sanitized mirror from private repository - 2026-04-04 12:42:10 UTC
2026-04-04 12:42:10 +00:00

29 lines
682 B
TypeScript

import { cn } from "@/lib/utils";
const colorMap: Record<string, string> = {
green: "bg-green-500",
red: "bg-red-500",
amber: "bg-amber-500",
blue: "bg-blue-500",
purple: "bg-purple-500",
};
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>
);
}