import cx from "classnames";
import React from "react";

const CLASS_ROOT = "label";

export interface LabelProps
  extends React.LabelHTMLAttributes<HTMLLabelElement> {
  htmlFor: string;
  className?: string;
  children?: React.ReactNode;
}

const Label: React.FC<LabelProps> = ({
  htmlFor,
  className,
  children,
  ...other
}) => (
  <label htmlFor={htmlFor} className={cx(CLASS_ROOT, className)} {...other}>
    {children}
  </label>
);

Label.displayName = "Label";

export { Label };
