import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";

interface PriorityBadgeProps {
  priority: string;
  className?: string;
}

export function PriorityBadge({ priority, className }: PriorityBadgeProps) {
  const normalized = priority.toLowerCase();
  
  let variantClass = "bg-slate-100 text-slate-800 border-slate-200";
  
  if (normalized === "high") {
    variantClass = "bg-rose-100 text-rose-800 border-rose-200";
  } else if (normalized === "medium") {
    variantClass = "bg-amber-100 text-amber-800 border-amber-200";
  } else if (normalized === "low") {
    variantClass = "bg-slate-100 text-slate-700 border-slate-200";
  }

  return (
    <Badge variant="outline" className={cn("capitalize px-2.5 py-0.5 font-medium border", variantClass, className)}>
      {priority}
    </Badge>
  );
}
