<commit_before>import React from 'react';
import autoBind from 'react-autobind';
import Checkbox from 'js/components/common/checkbox';

/**
 * @namespace MultiCheckboxItem
 * @prop {boolean} checked
 * @prop {boolean} disabled
 * @prop {string} label
 */

/**
 * A MultiCheckbox generic component.
 *
 * @prop {MultiCheckboxItem[]} items
 * @prop {function} onChange - returns whole list whenever any item changes
 */
class MultiCheckbox extends React.Component {
  constructor(props){
    super(props);
    autoBind(this);
  }

  onChange(response) {
    let updatedList = this.props.items;
    updatedList[response].checked = !updatedList[response].checked;
    this.props.onChange(updatedList);
  }

  render() {
    return (
      <div className='project-downloads__column project-downloads__column--right'>
        <span className='project-downloads__title'>
          {this.props.label}
        </span>
        <ul className='project-downloads__questions-list'>
          {this.props.items.map((item, n) => {
            return (
              <li key={n}>
                <Checkbox
                  disabled={item.disabled || false}
                  checked={item.checked || false}
                  onChange={this.onChange.bind(this, n)}
                  label={item.label}
                />
              </li>
            );
          })}
        </ul>
      </div>
    );
  }
}

export default MultiCheckbox;<commit_msg>WIP moving css, improved checkbox logic, cleanup<commit_after>import React from 'react';
import autoBind from 'react-autobind';
import Checkbox from 'js/components/common/checkbox';

/**
 * @namespace MultiCheckboxItem
 * @prop {boolean} checked
 * @prop {boolean} disabled
 * @prop {string} label
 */

/**
 * A MultiCheckbox generic component.
 *
 * @prop {MultiCheckboxItem[]} items
 * @prop {function} onChange - returns whole list whenever any item changes
 */
class MultiCheckbox extends React.Component {
  constructor(props){
    super(props);
    autoBind(this);
  }

  onChange(itemIndex, isChecked) {
    let updatedList = this.props.items;
    updatedList[itemIndex].checked = isChecked;
    this.props.onChange(updatedList);
  }

  render() {
    return (
      <ul className='multi-checkbox multi-checkbox__list'>
        {this.props.items.map((item, itemIndex) => {
          return (
            <li className='multi-checkbox__list-item' key={itemIndex}>
              <Checkbox
                checked={item.checked}
                disabled={item.disabled}
                onChange={this.onChange.bind(this, itemIndex)}
                label={item.label}
              />
            </li>
          );
        })}
      </ul>
    );
  }
}

export default MultiCheckbox;
{'fraction_non_alphanumeric': 0.1260102865540044, 'fraction_numerical': 0.0, 'mean_word_length': 2.3952618453865338, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4115084', 'n_tokens_mistral': 770, 'n_tokens_neox': 756, 'n_words': 166}