import { forwardRef, LabelHTMLAttributes } from 'react';
import { cx } from 'class-variance-authority';

import './label.css';

type LabelRef = HTMLLabelElement;
type LabelProps = LabelHTMLAttributes<LabelRef>;

export const Label = forwardRef<LabelRef, LabelProps>(({ className, ...delegated }, ref) => {
  return <label ref={ref} className={cx('c-label', className)} {...delegated} />;
});

Label.displayName = 'Label';
