content: import React from 'react';
  import { FormattedMessage } from 'react-intl';
  import styles from './styles.css';
  
  function getStyles(classRefs) {
    const classes = [];
    classRefs.split(' ').forEach((className) => {
      classes.push(styles[className]);
    });
    return classes.join(' ');
  }
  
  const RenderFieldVM = ({ name, input, disabled, maxLength, placeholder, label, type }) => (
    <div className={styles.form_control_group}>
      {type !== 'checkbox' && (<label htmlFor={name} className={styles.form_control_label}>
        <FormattedMessage {...label} />
      </label>)}
  
      <input
        id={name}
        {...input}
        placeholder={placeholder}
        maxLength={maxLength}
        type={type}
  
        className={getStyles('form_control_field')}
        disabled={disabled}
      />
      {type === 'checkbox' && (
        <label htmlFor={name} className={styles.form_control_label}>
          <FormattedMessage {...label} values={{ pro: <a href="#p">Proposta</a>, reg: <a href="#r">Regulamento</a> }} />
        </label>)
      }
  
    </div>
  );
  
  RenderFieldVM.propTypes = {
    input: React.PropTypes.object,
    label: React.PropTypes.object,
    name: React.PropTypes.string,
    type: React.PropTypes.string,
    meta: React.PropTypes.object,
    placeholder: React.PropTypes.string,
    maxLength: React.PropTypes.number,
    disabled: React.PropTypes.bool,
  };
  
  export default RenderFieldVM;
  