<commit_before>import React, { PropTypes } from 'react';
import FA from 'react-fontawesome';
import PureComponent from 'react-pure-render/component';
import { Panel } from 'react-bootstrap';
import classnames from 'classnames';


export default class Block extends PureComponent {
  static displayName = 'Block';
  static propTypes = {
    title: PropTypes.string,
    time: PropTypes.string,
    challenges: PropTypes.array
  };

  renderChallenges(challenges) {
    if (!Array.isArray(challenges) || !challenges.length) {
      return <div>No Challenges Found</div>;
    }
    return challenges.map(challenge => {
      const { title, dashedName, isLocked, isRequired } = challenge;
      const challengeClassName = classnames({
        'text-primary': true,
        'padded-ionic-icon': true,
        'negative-15': true,
        'challenge-title': true,
        'ion-checkmark-circled': !isLocked,
        'ion-locked': isLocked,
        'disabled': isLocked
      });
      if (isLocked) {
        return (
          <p
            className={ challengeClassName }
            key={ title }>
            { title }
            {
              isRequired ?
                <span className='text-primary'><strong>*</strong></span> :
                ''
            }
          </p>
        );
      }
      return (
        <p
          className={ challengeClassName }
          key={ title }>
          <a href={ `/challenges/${dashedName}` }>
            { title }
            <span className='sr-only'>complete</span>
            {
              isRequired ?
                <span className='text-primary'><strong>*</strong></span> :
                ''
            }
          </a>
        </p>
      );
    });
  }

  render() {
    const { title, time, challenges } = this.props;
    return (
      <Panel
        bsClass='map-accordion-panel-nested'
        collapsible={ true }
        expanded={ true }
        header={
          <div>
            <h3><FA name='caret-right' />{ title }</h3>
            <span className='challenge-block-time'>({ time })</span>
          </div>
        }
        id={ title }
        key={ title }>
        { this.renderChallenges(challenges) }
      </Panel>
    );
  }<commit_msg>Make map links react aware<commit_after>import React, { PropTypes } from 'react';
import { Link } from 'react-router';
import FA from 'react-fontawesome';
import PureComponent from 'react-pure-render/component';
import { Panel } from 'react-bootstrap';
import classnames from 'classnames';


export default class Block extends PureComponent {
  static displayName = 'Block';
  static propTypes = {
    title: PropTypes.string,
    time: PropTypes.string,
    challenges: PropTypes.array
  };

  renderChallenges(challenges) {
    if (!Array.isArray(challenges) || !challenges.length) {
      return <div>No Challenges Found</div>;
    }
    return challenges.map(challenge => {
      const { title, dashedName, isLocked, isRequired } = challenge;
      const challengeClassName = classnames({
        'text-primary': true,
        'padded-ionic-icon': true,
        'negative-15': true,
        'challenge-title': true,
        'ion-checkmark-circled': !isLocked,
        'ion-locked': isLocked,
        disabled: isLocked
      });
      if (isLocked) {
        return (
          <p
            className={ challengeClassName }
            key={ title }>
            { title }
            {
              isRequired ?
                <span className='text-primary'><strong>*</strong></span> :
                ''
            }
          </p>
        );
      }
      return (
        <p
          className={ challengeClassName }
          key={ title }>
          <Link to={ `/challenges/${dashedName}` }>
            { title }
            <span className='sr-only'>complete</span>
            {
              isRequired ?
                <span className='text-primary'><strong>*</strong></span> :
                ''
            }
          </Link>
        </p>
      );
    });
  }

  render() {
    const { title, time, challenges } = this.props;
    return (
      <Panel
        bsClass='map-accordion-panel-nested'
        collapsible={ true }
        expanded={ true }
        header={
          <div>
            <h3><FA name='caret-right' />{ title }</h3>
            <span className='challenge-block-time'>({ time })</span>
          </div>
        }
        id={ title }
        key={ title }>
        { this.renderChallenges(challenges) }
      </Panel>
    );
  }
{'fraction_non_alphanumeric': 0.13593958240781875, 'fraction_numerical': 0.001776988005330964, 'mean_word_length': 1.7524449877750612, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 59, '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': '4728115', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1270, 'n_words': 270}