"use client";

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

interface EnrichmentBadgeProps {
  category: string;
  className?: string;
  size?: "sm" | "xs";
}

const categoryColors: Record<string, string> = {
  security: "bg-red-500/20 text-red-700 dark:text-red-300",
  architecture: "bg-blue-500/20 text-blue-700 dark:text-blue-300",
  performance: "bg-emerald-500/20 text-emerald-700 dark:text-emerald-300",
  compliance: "bg-purple-500/20 text-purple-700 dark:text-purple-300",
  configuration: "bg-amber-500/20 text-amber-700 dark:text-amber-300",
};

export function EnrichmentBadge({ category, className, size = "xs" }: EnrichmentBadgeProps) {
  const color = categoryColors[category.toLowerCase()] || "bg-slate-500/20 text-slate-700 dark:text-slate-300";
  const sizeClass = size === "xs" ? "text-[10px] px-1.5 py-0.5" : "text-xs px-2.5 py-0.5";

  return (
    <span
      className={cn(
        "inline-flex items-center rounded font-medium",
        color,
        sizeClass,
        className
      )}
    >
      {category}
    </span>
  );
}
