<commit_before>import React, { Component } from 'react';

class Events extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selected: props.event,
    };
  }
  set selected(event) {
    this.setState(Object.assign({}, this.state, { selected: event }));
    if (this.props.onEventChanged) {
      this.props.onEventChanged(event);
    }
  }
  get selected() {
    return this.state.selected;
  }
  appendMDL(ref) {
    if (ref) {
      // componentHandler.upgradeElement(ref);
    }
  }
  render() {
    const eventButtons = [];
    for (const event of this.props.events) {
      let btnClass = '';
      if (this.selected && this.selected.id === event.id) {
        btnClass = 'selected';
      }
      eventButtons.push(
        <button ref={a => this.appendMDL(a)} className={btnClass} onClick={() => { this.selected = event; }}
           key={event.id}>{event.name}</button>
      );
    }

    return (
      <div className="events">
        <h2>Arrangementer</h2>
        <div>
          { eventButtons }
        </div>
      </div>
    );
  }
}

export default Events;
<commit_msg>Removed appendMDL, still no idea what it did<commit_after>import React, { Component } from 'react';

class Events extends Component {
  constructor(props) {
    super(props);
    this.state = {
      selected: props.event,
    };
  }
  set selected(event) {
    this.setState(Object.assign({}, this.state, { selected: event }));
    if (this.props.onEventChanged) {
      this.props.onEventChanged(event);
    }
  }
  get selected() {
    return this.state.selected;
  }
  render() {
    const eventButtons = [];
    for (const event of this.props.events) {
      let btnClass = '';
      if (this.selected && this.selected.id === event.id) {
        btnClass = 'selected';
      }
      eventButtons.push(
        <button className={btnClass} onClick={() => { this.selected = event; }}
           key={event.id}>{event.name}</button>
      );
    }

    return (
      <div className="events">
        <h2>Arrangementer</h2>
        <div>
          { eventButtons }
        </div>
      </div>
    );
  }
}

export default Events;

{'fraction_non_alphanumeric': 0.15281003251277286, 'fraction_numerical': 0.0018578727357176034, 'mean_word_length': 2.283536585365854, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 22, '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': '2201123', 'n_tokens_mistral': 678, 'n_tokens_neox': 686, 'n_words': 135}