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

export default class PurchaseButton extends Component {
  render() {
    const {products} = this.props.products;
    let total = products
      .filter((p) => !p.loading)
      .map((p) => p.price * p.qty).reduce((x, y) => x + y, 0);
    return (
      <span id="buy" className="button" href="#">
        <span>{total}</span>
        <span> kr</span>
        <div>
          <i className="fa fa-shopping-cart"></i>
          <span></span>
        </div>
      </span>
    );
  }
}

// PurchaseButton.propTypes = {
//   products: PropTypes.array
// };<commit_msg>Button changes to active state when total cost > 0<commit_after>import React, { PropTypes, Component } from 'react';

export default class PurchaseButton extends Component {
  render() {
    const {products} = this.props.products;
    let total = products
      .filter((p) => !p.loading)
      .map((p) => p.price * p.qty).reduce((x, y) => x + y, 0);
    return (
      <span id="buy" className={total > 0 ? 'button active' : 'button'} href="#">
        {total} kr <i className="fa fa-shopping-cart"></i>
      </span>
    );
  }
}

// PurchaseButton.propTypes = {
//   products: PropTypes.array
// };
{'fraction_non_alphanumeric': 0.17842660178426603, 'fraction_numerical': 0.0032441200324412004, 'mean_word_length': 2.5768115942028986, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 27, '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': '1977825', 'n_tokens_mistral': 401, 'n_tokens_neox': 394, 'n_words': 100}