<commit_before>import React, {PureComponent } from 'react';
import { string, object  } from 'prop-types';
import { BaseEntityQuery } from 'utils/genny';
import distanceInWords from 'date-fns/distance_in_words';


class TimeAgoInWords extends PureComponent {
  
    static propTypes = {
        code: string,
        style: object
    }

    renderFromNow = (code) => {
        if (code) {
            let createdAt = BaseEntityQuery.getBaseEntity(code);
            if(createdAt && createdAt.created) { 
              const date = createdAt.created;
                return distanceInWords(date, Date.now());
            }
            else { 
              return null;
            }
    }
    else { 
      return null;
    }
  }

    render() {
      const {style, code} = this.props;
        const componentStyle = { ...style, };
        
        return (
            <span className="time-ago-in-words" style={componentStyle}>
                {
                    code ?
                    this.renderFromNow( code) :
                    null
                }
            </span>
        );
    }
}

export default TimeAgoInWords;
<commit_msg>changes<commit_after>import React, {PureComponent } from 'react';
import { string, object  } from 'prop-types';
import { BaseEntityQuery } from 'utils/genny';
import distanceInWords from 'date-fns/distance_in_words';

class TimeAgoInWords extends PureComponent {
    static propTypes = {
        code: string,
        style: object
    }
    renderFromNow = (code) => {
      if (code) {
        let createdAt = BaseEntityQuery.getBaseEntity(code);
        if(createdAt && createdAt.created) { 
          const date = createdAt.created;
          return distanceInWords(date, Date.now());
        }
        else { 
          return null;
        }
    }
    else { 
      return null;
    }
  }

    render() {
      const {style, code} = this.props;
        const componentStyle = { ...style, };
        return (
          <span className="time-ago-in-words" style={componentStyle}>
            {
              code ?
              this.renderFromNow( code) :
              null
            }
          </span>
        );
    }
}

export default TimeAgoInWords;

{'fraction_non_alphanumeric': 0.1057866184448463, 'fraction_numerical': 0.0, 'mean_word_length': 1.6439665471923537, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1373564', 'n_tokens_mistral': 635, 'n_tokens_neox': 608, 'n_words': 138}