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>
  );
}
