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

import { ChipButtonProps } from './types'
import { variants } from './variants'

export function ChipButton({
  children,
  variant,
  selected = false,
  size = 'Large',
  className,
  ...props
}: ChipButtonProps) {
  const classNames = variants({
    variant,
    selected,
    size,
  })

  return (
    <ButtonRAC {...props} className={[className, classNames].join(' ')}>
      {children}
    </ButtonRAC>
  )
}
