<commit_before>import React from 'react'
import {Button, ButtonGroup, ButtonToolbar, FormControls, Input, Modal, Panel, ListGroup, ListGroupItem, Glyphicon, Table} from 'react-bootstrap';
import NumeralInputWithUnits from './NumeralInputWithUnits'

export default class ReactionDetailsMaterials extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      samples: props.samples || [],
      materialGroup: props.materialGroup
    }
  }

  componentWillReceiveProps(nextProps) {
    this.setState({
      samples: nextProps.samples
    })
  }

  render() {
    let rows = this.state.samples.map((sample)=> (
      <tr key={sample.id}>
        <td width="5%">
          <input type="checkbox" />
        </td>
        <td width="25%">{sample.name}</td>
        <td width="25%">{sample.molecule.sum_formular}</td>
        <td width="25%">
          <NumeralInputWithUnits
             key={sample.id}
             value={sample.amount_value}
             unit={sample.amount_unit || 'g'}
             units={['g', 'ml', 'mol']}
             numeralFormat='0,0.00'
             convertValueFromUnitToNextUnit={(unit, nextUnit, value) => this.handleUnitChanged(unit, nextUnit, value)}
             onChange={(amount) => this.handleAmountChanged(amount)}
          />
        </td>
        <td width="20%">
          <Input type="text" value={1.0} disabled />
        </td>
      </tr>
    ));

    return (<commit_msg>Use radio button for reference material<commit_after>import React from 'react'
import {Button, ButtonGroup, ButtonToolbar, FormControls, Input, Modal, Panel, ListGroup, ListGroupItem, Glyphicon, Table} from 'react-bootstrap';
import NumeralInputWithUnits from './NumeralInputWithUnits'

export default class ReactionDetailsMaterials extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      samples: props.samples || [],
      materialGroup: props.materialGroup
    }
  }

  componentWillReceiveProps(nextProps) {
    this.setState({
      samples: nextProps.samples
    })
  }

  render() {
    let rows = this.state.samples.map((sample)=> (
      <tr key={sample.id}>
        <td width="5%">
          <input type="radio" name="reference" />
        </td>
        <td width="25%">{sample.name}</td>
        <td width="25%">{sample.molecule.sum_formular}</td>
        <td width="25%">
          <NumeralInputWithUnits
             key={sample.id}
             value={sample.amount_value}
             unit={sample.amount_unit || 'g'}
             units={['g', 'ml', 'mol']}
             numeralFormat='0,0.00'
             convertValueFromUnitToNextUnit={(unit, nextUnit, value) => this.handleUnitChanged(unit, nextUnit, value)}
             onChange={(amount) => this.handleAmountChanged(amount)}
          />
        </td>
        <td width="20%">
          <Input type="text" value={1.0} disabled />
        </td>
      </tr>
    ));

    return (
{'fraction_non_alphanumeric': 0.14631650750341063, 'fraction_numerical': 0.010231923601637109, 'mean_word_length': 2.5637910085054676, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '826766', 'n_tokens_mistral': 888, 'n_tokens_neox': 864, 'n_words': 172}