<commit_before>var Tags = React.createClass({
    render: function() {
        var tags = this.props.tags || [],
            tagString = '';
        if (tags.length == 0)
            tagString = 'No tags';
        else
            tagString = tags.join(', ');
        return (
            <div className="tag">
            Tags: {tagString}
            </div>
        );
    }
})

var Badge = React.createClass({
    render: function() {
        var badgeObj = this.props.badge;
        var thisYear = badgeObj.created_at.getFullYear();
        var lastYear = undefined;
        if (this.props.lastDate)
            lastYear = this.props.lastDate.getFullYear();
        var dividerClassList = 'divider';
        var isNewYear = lastYear && thisYear !== lastYear;
        var newYear = '';
        if (isNewYear) {
            dividerClassList += ' newYear';
            newYear = this.props.isDescending ? lastYear : thisYear;
        }
        return (
            <div>
            <div className={dividerClassList}>{newYear}</div>
            <div className="badgeContainer">
            <div className="badgeItem">
            <div className="badgeImgContainer">
            <a href={badgeObj.link}>
            <img className="badgeImg" src={badgeObj.URL} alt={badgeObj.title} onload="this.style.opacity='1';" />
            </a>
            </div>
            <div className="block">
            <h3>{badgeObj.name}</h3>
            <p>{badgeObj.comment}</p>
            </div>
            <Tags tags={badgeObj.category_tags} />
            </div>
            </div>
            </div>
        );
    }
});

var BadgeList = React.createClass({
    componentDidMount: function () {

    },
    getInitialState: function() {<commit_msg>Fixed a bug where badges with no link would link back to the badge guide. Now they link to nothing.<commit_after>var Tags = React.createClass({
    render: function() {
        var tags = this.props.tags || [],
            tagString = '';
        if (tags.length == 0)
            tagString = 'No tags';
        else
            tagString = tags.join(', ');
        return (
            <div className="tag">
            Tags: {tagString}
            </div>
        );
    }
});

var BadgeImg = React.createClass({
    render: function() {
        var imgContainer = undefined;
        if (this.props.link) {
            imgContainer = <a href={this.props.link}><img className="badgeImg" src={this.props.url} alt={this.props.title} onload="this.style.opacity='1';" /></a>
        } else {
            imgContainer = <img className="badgeImg" src={this.props.url} alt={this.props.title} onload="this.style.opacity='1';" />
        }
        return (
            <div className="badgeImgContainer">
            {imgContainer}
            </div>
        );
    }
});

var Badge = React.createClass({
    render: function() {
        var badgeObj = this.props.badge;
        var thisYear = badgeObj.created_at.getFullYear();
        var lastYear = undefined;
        if (this.props.lastDate)
            lastYear = this.props.lastDate.getFullYear();
        var dividerClassList = 'divider';
        var isNewYear = lastYear && thisYear !== lastYear;
        var newYear = '';
        if (isNewYear) {
            dividerClassList += ' newYear';
            newYear = this.props.isDescending ? lastYear : thisYear;
        }
        return (
            <div>
            <div className={dividerClassList}>{newYear}</div>
            <div className="badgeContainer">
            <div className="badgeItem">
            <BadgeImg link={badgeObj.link} url={badgeObj.URL} title={badgeObj.title} />
            <div className="block">
            <h3>{badgeObj.name}</h3>
            <p>{badgeObj.comment}</p>
            </div>
            <Tags tags={badgeObj.category_tags} />
            </div>
            </div>
            </div>
        );
    }
});

var BadgeList = React.createClass({
    componentDidMount: function () {

    },
    getInitialState: function() {
{'fraction_non_alphanumeric': 0.13907615480649188, 'fraction_numerical': 0.0022471910112359553, 'mean_word_length': 1.776160776160776, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, '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': '3330719', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1154, 'n_words': 234}