import { cn } from "../lib/cn";

export function Badge({
  children,
  tone = "neutral",
  className,
}) {
  return (
    <span
      className={cn(
        "inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold",
        {
          "bg-paper text-muted": tone === "neutral",
          "bg-accent-soft text-accent-dark": tone === "accent",
          "bg-success-soft text-success": tone === "success",
          "bg-warning-soft text-warning": tone === "warning",
          "bg-danger-soft text-danger": tone === "danger",
        },
        className,
      )}
    >
      {children}
    </span>
  );
}
