import { Badge } from "@/components/ui/badge";
import type { AuditVerdictDto } from "@/lib/api/types";

interface VerdictBadgeProps {
  verdict: AuditVerdictDto;
}

export function VerdictBadge({ verdict }: VerdictBadgeProps) {
  const config: Record<
    AuditVerdictDto,
    { variant: "default" | "destructive" | "secondary" | "outline"; label: string; className?: string }
  > = {
    pass: { variant: "default", label: "PASS", className: "bg-green-600" },
    conflict: { variant: "destructive", label: "CONFLICT" },
    missing: { variant: "secondary", label: "MISSING" },
    unclaimed: { variant: "outline", label: "UNCLAIMED" },
  };

  const { variant, label, className } = config[verdict];

  return (
    <Badge variant={variant} className={className}>
      {label}
    </Badge>
  );
}
