<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { css } from 'emotion';
import { Color } from 'constants/css';
import { connect } from 'react-redux';
import { addCommasToNumber } from 'helpers/stringHelpers';
import { returnMaxStars } from 'constants/defaultValues';
import LoadMoreButton from 'components/Buttons/LoadMoreButton';
import Comment from './Comment';
import Starmarks from './Starmarks';

class RewardStatus extends Component {
  static propTypes = {
    difficulty: PropTypes.number,
    userId: PropTypes.number,
    noMarginForEditButton: PropTypes.bool,
    onCommentEdit: PropTypes.func,
    stars: PropTypes.array,
    style: PropTypes.object
  };

  state = {
    loaded: 1
  };

  render() {
    const {
      difficulty,
      noMarginForEditButton,
      onCommentEdit,
      stars,
      userId,
      style
    } = this.props;
    const { loaded } = this.state;
    const maxStars = returnMaxStars({ difficulty });
    let rewardedStars = stars.reduce(
      (prev, star) => prev + star.rewardAmount,
      0<commit_msg>made reward comment show<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { css } from 'emotion';
import { Color } from 'constants/css';
import { connect } from 'react-redux';
import { addCommasToNumber, stringIsEmpty } from 'helpers/stringHelpers';
import { returnMaxStars } from 'constants/defaultValues';
import LoadMoreButton from 'components/Buttons/LoadMoreButton';
import Comment from './Comment';
import Starmarks from './Starmarks';

class RewardStatus extends Component {
  static propTypes = {
    difficulty: PropTypes.number,
    userId: PropTypes.number,
    noMarginForEditButton: PropTypes.bool,
    onCommentEdit: PropTypes.func,
    stars: PropTypes.array,
    style: PropTypes.object
  };

  state = {
    loaded: 2
  };

  render() {
    let {
      difficulty,
      noMarginForEditButton,
      onCommentEdit,
      stars = [],
      userId,
      style
    } = this.props;
    const finalStar = stars.length > 0 ? stars[stars.length - 1] : {};
    const starsWithComment = stars.filter(
      star => !stringIsEmpty(star.rewardComment) && star.id !== finalStar.id
    );
    const starsWithoutComment = stars.filter(
      star => stringIsEmpty(star.rewardComment) && star.id !== finalStar.id
    );
    stars = starsWithoutComment
      .concat(starsWithComment)
      .concat(finalStar.id ? [finalStar] : []);
    const { loaded } = this.state;
    const maxStars = returnMaxStars({ difficulty });
    let rewardedStars = stars.reduce(
      (prev, star) => prev + star.rewardAmount,
      0
{'fraction_non_alphanumeric': 0.11419984973703982, 'fraction_numerical': 0.002253944402704733, 'mean_word_length': 3.3943894389438944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '7306554', 'n_tokens_mistral': 771, 'n_tokens_neox': 794, 'n_words': 200}