{"size": 881, "ext": "js", "max_stars_repo_path": "src/js/badgeinfo.js", "max_stars_repo_name": "aaronsky500/badges", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/js/badgeinfo.js", "max_issues_repo_name": "aaronsky500/badges", "max_issues_repo_issues_event_min_datetime": "2015-07-27T04:17:53.000Z", "max_issues_repo_issues_event_max_datetime": "2020-02-03T07:43:41.000Z", "max_forks_repo_path": "src/js/badgeinfo.js", "max_forks_repo_name": "aaronsky500/badges", "max_forks_repo_forks_event_min_datetime": "2015-07-02T04:50:50.000Z", "max_forks_repo_forks_event_max_datetime": "2016-08-10T22:27:31.000Z"}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": 4, "avg_line_length": 25.1714285714, "max_line_length": 65, "alphanum_fraction": 0.4097616345}
var React = require('react');

var BadgeInfo = React.createClass({
    getInfo: function (badge) {
        return (
            <li key={badge.id}>
            {badge.name}<br />
            {badge.comment}
            </li>
        );
    },
    render: function () {
        var badge = this.props.badge;
        if (badge.isGroup) {
            var individualInfos = badge.badges.map(this.getInfo);
            return (
                <div className="block">
                <h3>{badge.title}</h3>
                <ul className="badgeGroup">
                {individualInfos}
                </ul>
                </div>
            );
        } else {
            return (
                <div className="block">
                <h3>{badge.name}</h3>
                <p>{badge.comment}</p>
                </div>
            );
        }
    }
});

module.exports = BadgeInfo;