import * as React from "react";
import { cn } from "@/lib/utils";

type BadgeVariant = "neutral" | "success" | "warning";

const variantClasses: Record<BadgeVariant, string> = {
  neutral: "bg-[#eaf0fb] text-[#2e4c83]",
  success: "bg-[#dff6e8] text-[#1c7a4a]",
  warning: "bg-[#fff5dd] text-[#916400]",
};

export function Badge({
  className,
  variant = "neutral",
  ...props
}: React.HTMLAttributes<HTMLSpanElement> & { variant?: BadgeVariant }) {
  return (
    <span
      className={cn(
        "inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold tracking-wide",
        variantClasses[variant],
        className,
      )}
      {...props}
    />
  );
}
