import * as React from "react" import { Slot } from "@radix-ui/react-slot" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const badgeVariants = cva( "inline-flex h-6 items-center justify-center rounded-sm border px-2 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none aria-invalid:border-destructive transition-colors duration-150 overflow-hidden", { variants: { variant: { default: "border-transparent bg-foreground text-background [a&]:hover:bg-foreground/90", secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/80", destructive: "border-transparent bg-destructive text-background [a&]:hover:bg-destructive/90", outline: "text-foreground [a&]:hover:bg-hover", }, }, defaultVariants: { variant: "default", }, } ) function Badge({ className, variant, asChild = false, ...props }: React.ComponentProps<"span"> & VariantProps & { asChild?: boolean }) { const Comp = asChild ? Slot : "span" return ( ) } export { Badge, badgeVariants }