import { Button as ButtonRAC } from 'react-aria-components'

import { VariantProps } from 'class-variance-authority'
import { ComponentProps } from 'react'
import { variants } from './variants'

interface IconButtonProps
  extends ComponentProps<typeof ButtonRAC>,
    VariantProps<typeof variants> {}

export function IconButton({
  variant,
  emphasis,
  size,
  className,
  ...props
}: IconButtonProps) {
  const classNames = variants({
    variant,
    emphasis,
    size,
    className,
  })

  return <ButtonRAC {...props} className={classNames} />
}
