import * as React from "react";
import { cva } from "class-variance-authority";

import { cn } from "@/lib/utils";

const badgeVariants = cva(
  "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
  {
    variants: {
      variant: {
        default:
          "border-transparent bg-primary text-primary-foreground shadow ",
        secondary:
          "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
        destructive:
          "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
        outline: "text-foreground",
        green:
          "border-transparent bg-[var(--green-forest)] text-white hover:bg-[var(--green-fern)]",
        orange:
          "border-transparent bg-orange-500 text-white hover:bg-orange-500/80",
        orange2:
          "border-transparent bg-orange-100 text-orange-700 hover:bg-orange-100/80",
        pink: "border-transparent bg-[var(--pink-500)] text-white hover:bg-[var(--pink-500)]/80",
        red: "border-transparent bg-red-100 text-red-700 hover:bg-red-100/80",
        red2: "border-transparent bg-red-500 text-white hover:bg-red-500/80",
        gray: "border-transparent bg-gray-200 text-gray-700 hover:bg-gray-200/80",
        gray2: "border-transparent bg-gray-400 text-white hover:bg-gray-400/80",
        gray3:
          "border-transparent bg-gray-300 text-gray-600 hover:bg-gray-300/80",
        purple: "bg-light-lavender",
      },
    },
    defaultVariants: {
      variant: "default",
    },
  }
);

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

export { Badge, badgeVariants };
