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 focus:outline-none focus:ring-2 focus:ring-phoenix-fire focus:ring-offset-2',
  {
    variants: {
      variant: {
        default: 'border-studio-medium bg-studio-medium text-foreground',
        success: 'border-status-success bg-status-success/10 text-status-success',
        error: 'border-status-error bg-status-error/10 text-status-error',
        warning: 'border-status-warning bg-status-warning/10 text-status-warning',
        info: 'border-status-info bg-status-info/10 text-status-info',
        outline: 'text-foreground',
      },
    },
    defaultVariants: {
      variant: 'default',
    },
  }
)

export 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 }

