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

const badgeVariants = cva('shBadge', {
  variants: {
    variant: {
      default: 'shBadgeDefault',
      secondary: 'shBadgeSecondary',
      outline: 'shBadgeOutline',
      success: 'shBadgeSuccess',
      warning: 'shBadgeWarning',
      destructive: 'shBadgeDestructive',
    },
  },
  defaultVariants: {
    variant: 'default',
  },
});

export function Badge(props: React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>) {
  const { className, variant, ...rest } = props;
  return <div className={cn(badgeVariants({ variant, className }))} {...rest} />;
}
