<commit_before>const React = require('react');

import ApiClient from '../utilities/ApiClient';
import ReportbackItem from './ReportbackItem';

/**
 * ReportbackItemsSlide Component
 * <ReportbackItemsSlide />
 */
class ReportbackItemsSlide extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      reportbackItems: null
    };

    this.apiClient = new ApiClient('v1');
    this.reportbackItems = null;
  }

  componentDidMount() {
    const reportbackItems = this.apiClient.get('reportback-items', {
      'campaigns': this.props.campaign.id,
      'random': true,
      'count': 4,
      'status': 'promoted,approved'
    }, (response) => {
      this.setState({
        reportbackItems: response.data
      });
    });
  }

  renderReportbackItems(data, index) {
    return <li key={`list-item-${index}`}><ReportbackItem key={index} data={data} /></li>;
  }

  render() {
    const user = this.props.user;

    let listContent = 'Waiting for content...';

    if (!this.state.reportbackItems) {
      // @TODO: Add loading spinnner??
    }

    if (this.state.reportbackItems) {
      listContent = this.state.reportbackItems.map(this.renderReportbackItems);
    }

    return (
      <div className={`slideshow__slide ${this.props.isActive ? '-active fade-in': ''}`}>
        <div className="container">
          <div className="wrapper">

            <div className="container__row">
              <div className="container__block">
                <h2 className="heading -gamma">These members are rocking it already!</h2>
                <p>{/*Tap the heart to show them some love. */}We can't wait to see YOUR photos{user.info ? ', ' + user.info.first_name : ''}!</p>
              </div>
            </div>

            <div className="container__row">
              <div className="container__block">
                <ul className="gallery -quartet">
                  {listContent}
                </ul>
              </div>
            </div>

          </div>
        </div>
      </div>
    );
  }
}

export default ReportbackItemsSlide;
<commit_msg>Passing user information as a prop.<commit_after>const React = require('react');

import ApiClient from '../utilities/ApiClient';
import ReportbackItem from './ReportbackItem';

/**
 * ReportbackItemsSlide Component
 * <ReportbackItemsSlide />
 */
class ReportbackItemsSlide extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      reportbackItems: null
    };

    this.apiClient = new ApiClient('v1');
    this.reportbackItems = null;

    this.renderReportbackItems = this.renderReportbackItems.bind(this);
  }

  componentDidMount() {
    this.apiClient.get('reportback-items', {
      campaigns: this.props.campaign.id,
      random: true,
      count: 4,
      status: 'promoted,approved'
    }).then(response => {
      this.setState({
        reportbackItems: response.data
      });
    });
  }

  renderReportbackItems(data, index) {
    return <li key={`list-item-${index}`}><ReportbackItem key={index} data={data} user={this.props.user} /></li>;
  }

  render() {
    const user = this.props.user;

    let listContent = 'Waiting for content...';

    if (!this.state.reportbackItems) {
      // @TODO: Add loading spinnner??
    }

    if (this.state.reportbackItems) {
      listContent = this.state.reportbackItems.map(this.renderReportbackItems);
    }

    return (
      <div className={`slideshow__slide ${this.props.isActive ? '-active fade-in': ''}`}>
        <div className="container">
          <div className="wrapper">

            <div className="container__row">
              <div className="container__block">
                <h2 className="heading -gamma">These members are rocking it already!</h2>
                <p>{/*Tap the heart to show them some love. */}We can't wait to see YOUR photos{user.info ? ', ' + user.info.first_name : ''}!</p>
              </div>
            </div>

            <div className="container__row">
              <div className="container__block">
                <ul className="gallery -quartet">
                  {listContent}
                </ul>
              </div>
            </div>

          </div>
        </div>
      </div>
    );
  }
}

export default ReportbackItemsSlide;

{'fraction_non_alphanumeric': 0.14269060387036606, 'fraction_numerical': 0.0018652366519002097, 'mean_word_length': 2.3359253499222397, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 53, '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': '3406439', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1246, 'n_words': 264}