<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import List, {
  ListItem,
  ListItemSecondaryAction,
  ListItemText,
} from 'material-ui/List';
import Switch from 'material-ui/Switch';


const capitalize = string => `${string[0].toUpperCase().concat(string.slice(1))}`;

const renderItems = (products, onRemove, onAdd, translations, userProducts) =>
  products.map((item, i) => {
    const selected = userProducts.includes(item._id);
    const cb = selected ? onRemove : onAdd;
    return (
      <ListItem key={i.toString()}>
        <ListItemText primary={capitalize(translations[item.name])} />
        <ListItemSecondaryAction>
          <Switch
            onChange={() => { cb(item._id); }}
            checked={selected}
          /><commit_msg>Added onClick to product list items<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import List, {
  ListItem,
  ListItemSecondaryAction,
  ListItemText,
} from 'material-ui/List';
import { Switch } from 'material-ui';


const capitalize = string => `${string[0].toUpperCase().concat(string.slice(1))}`;

const renderItems = (products, onRemove, onAdd, translations, userProducts) =>
  products.map((item, i) => {
    const selected = userProducts.includes(item._id);
    const cb = selected ? onRemove : onAdd;
    return (
      <ListItem onClick={() => { cb(item._id); }} className="ProductList__item" key={i.toString()}>
        <ListItemText primary={capitalize(translations[item.name])} />
        <ListItemSecondaryAction>
          <Switch
            onChange={() => { cb(item._id); }}
            checked={selected}
          />
{'fraction_non_alphanumeric': 0.1485748938750758, 'fraction_numerical': 0.002425712553062462, 'mean_word_length': 3.6089385474860336, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 20, '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': '4882693', 'n_tokens_mistral': 486, 'n_tokens_neox': 482, 'n_words': 108}