import React from 'react' ; import { LabelProps } from '../../FieldProps' ; const Label = ( props ) => { if ( props . labelComponent ) { const CustomLabel = props . labelComponent ; const { labelComponent , ... labelComponentProps } = props ; return < CustomLabel { ... labelComponentProps } / > ; } const { field , isValid , children } = props ; let className = field . model . labelCssClass ; if ( ! isValid ) { className += ' invalid' ; } return ( < label htmlFor = { field . valueField . id } className = { className } > { children } { field . model . title } < /label>); } ; export { Label } ;