import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"

const badgeVariants = cva(
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",
  {
    variants: {
      variant: {
        default: "border-transparent bg-cyan-600/80 text-cyan-50",
        secondary: "border-transparent bg-slate-700 text-slate-200",
        destructive: "border-transparent bg-red-600/80 text-red-50",
        success: "border-transparent bg-emerald-600/80 text-emerald-50",
        warning: "border-transparent bg-amber-600/80 text-amber-50",
        outline: "text-slate-300 border-slate-600",
      },
    },
    defaultVariants: {
      variant: "default",
    },
  }
)

interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}

function Badge({ className, variant, ...props }: BadgeProps) {
  return <div className={cn(badgeVariants({ variant }), className)} {...props} />
}

export { Badge, badgeVariants }
