content: import React from 'react';
  import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton';
  
  import dataActions from '../../actions/dataActions';
  
  export default class RadioButtonGroupForm extends React.Component {
  
    handleFormData = (event, value) => {
      const { formData } = this.props;
      dataActions.updateData(formData, value);
    };
  
    render() {
      const { data, label, value } = this.props;
      const defaultValue = value;
  
      const styles = {
        radioButton: {
          float: 'left',
          marginBottom: 5,
          marginRight: 10,
          width: '140px'
        },
        radioIconStyle: {
          marginRight: 5
        }
      }
  
      return (
        <div
          className="container__row"
        >
          <h3>
            {label}
          </h3>
          <RadioButtonGroup
            name={defaultValue}
            defaultSelected={defaultValue}
            onChange={this.handleFormData}
          >
            { data.map((r, i) =>
              <RadioButton
                key={i}
                value={r.value}
                label={r.label}
                iconStyle={styles.radioIconStyle}
                style={styles.radioButton}
              />
            )}
          </RadioButtonGroup>
        </div>
      )
    }
  
  }
  