import { inputLabelVariants } from './variants'

import type { InputLabelProps } from './types'

export function InputLabel({
  children,
  className,
  selected,
  required,
  disabled,
  size,
  ...rest
}: InputLabelProps) {
  const classNames = inputLabelVariants({
    size,
    required,
    selected,
    disabled,
    className,
  })

  return (
    <span className={classNames} {...rest}>
      {children}
      {required && <span aria-hidden="true">{' *'}</span>}
    </span>
  )
}
