import classnames from 'classnames'; import { Classes } from 'jss'; import { Component, LabelHTMLAttributes } from 'react'; import injectSheet from 'react-jss'; import { IFormField } from '../typings/generic'; import styles from './styles'; interface ILabel extends IFormField, LabelHTMLAttributes { classes: Classes; isRequired: boolean; } class LabelComponent extends Component { static defaultProps = { showLabel: true, }; render() { const { title, showLabel, classes, className, children, htmlFor, isRequired, } = this.props; if (!showLabel) return children; return ( ); } } export const Label = injectSheet(styles)(LabelComponent);