"use client";

import { cn } from "@/lib/utils";
import { SOURCE_STATUS_COLORS } from "@/lib/constants";

type SourceStatus = "active" | "deprecated" | "quarantined";

interface StatusBadgeProps {
  status: SourceStatus;
  size?: "sm" | "xs";
}

const STATUS_LABELS: Record<SourceStatus, string> = {
  active: "active",
  deprecated: "deprecated",
  quarantined: "blocked",
};

export function StatusBadge({ status, size = "sm" }: StatusBadgeProps) {
  return (
    <span
      className={cn(
        "inline-flex items-center rounded-full border font-medium",
        SOURCE_STATUS_COLORS[status],
        size === "sm" ? "px-2 py-0.5 text-xs" : "px-1.5 py-0.5 text-[10px]"
      )}
    >
      {STATUS_LABELS[status]}
    </span>
  );
}
