import React from 'react'
import { FieldLabel } from 'features/shared/components'
+import pick from 'lodash/pick'
+
+const TEXT_FIELD_PROPS = [
+ 'value',
+ 'onBlur',
+ 'onFocus',
+ 'name'
+]
class FileField extends React.Component {
constructor(props) {
}
render() {
-
+ const fieldProps = pick(this.props.fieldProps, TEXT_FIELD_PROPS)
+ const {touched, error} = this.props.fieldProps
return(
<div className='form-group'>
{this.props.title && <FieldLabel>{this.props.title}</FieldLabel>}
type='file'
onChange={this.onChange}
/>
+
+ {touched && error && <span className='text-danger'><strong>{error}</strong></span>}
{this.props.hint && <span className='help-block'>{this.props.hint}</span>}
</div>
)