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

type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
  tone?: "gold" | "sage" | "rust" | "neutral" | "bordeaux";
};

const tones: Record<NonNullable<BadgeProps["tone"]>, string> = {
  gold: "border-gold/50 bg-gold/10 text-bordeaux-ink",
  sage: "border-sage/40 bg-sage/10 text-sage",
  rust: "border-rust/40 bg-rust/10 text-rust",
  neutral: "border-smoke/30 bg-parchment/60 text-charcoal",
  bordeaux: "border-bordeaux-deep/30 bg-bordeaux-deep/10 text-bordeaux-deep"
};

export function Badge({ className, tone = "neutral", ...props }: BadgeProps) {
  return (
    <span
      className={cn(
        "inline-flex min-h-6 items-center rounded-md border px-2 py-0.5 text-xs font-medium",
        tones[tone],
        className
      )}
      {...props}
    />
  );
}
