<commit_before>import React, { PropTypes } from 'react';
import { Button, Col, Row, Panel } from 'react-bootstrap';
import { Navigation } from 'react-router';
import { contain } from 'thundercats-react';
import stampit from 'react-stampit';
import Vimeo from 'react-vimeo';
import debugFactory from 'debug';

const debug = debugFactory('freecc:hikes');

export default contain(
  {
    store: 'hikesStore',
    fetchAction: 'hikesActions.getHike',
    getPayload({ currentHike, hikes, params: { dashedName } }) {
      const filterRegex = new RegExp(dashedName, 'i');
      if (currentHike && filterRegex.test(currentHike.dashedName)) {
        return {
          hikes: [],
          isPrimed: true,
          dashedName
        };
      }
      return {
        hikes,
        isPrimed: false,
        dashedName: dashedName
      };
    }
  },
  stampit(React, {
    displayName: 'Lecture',

    propTypes: {
      params: PropTypes.object,
      currentHike: PropTypes.object
    },

    handleError: debug,

    handleFinish() {
      debug('loading questions');
      const { dashedName } = this.props.params;
      this.transitionTo(`/hikes/${dashedName}/questions/1`);
    },

    render() {
      const {
        title,
        challengeSeed = ['1'],
        description = []
      } = this.props.currentHike;
      const transcript = description.map(line => {
        return (
          <p>{ line }</p>
        );
      });

      const [ id ] = challengeSeed;

      const videoTitle = <h2>{ title }</h2>;
      return (
        <Col xs={ 12 }>
          <Row>
            <Panel className={ 'text-center' } title={ videoTitle }>
              <Vimeo
                onError={ this.handleError }
                onFinish= { ::this.handleFinish }
                videoId={ id } />
            </Panel>
          </Row>
          <Row>
            <Col xs={ 12 }>
              <Panel>
                <p>
                  { transcript }
                </p>
              </Panel>
              <Panel>
                <Button
                  block={ true }
                  bsSize='large'
                  onClick={ ::this.handleFinish }>
                  Take me to the Questions
                </Button>
              </Panel>
            </Col>
          </Row>
        </Col>
      );
    }
  }).compose(Navigation)
);<commit_msg>move transcript rending into method<commit_after>import React, { PropTypes } from 'react';
import { Button, Col, Row, Panel } from 'react-bootstrap';
import { Navigation } from 'react-router';
import { contain } from 'thundercats-react';
import stampit from 'react-stampit';
import Vimeo from 'react-vimeo';
import debugFactory from 'debug';

const debug = debugFactory('freecc:hikes');

export default contain(
  {
    store: 'hikesStore',
    fetchAction: 'hikesActions.getHike',
    getPayload({ currentHike, hikes, params: { dashedName } }) {
      const filterRegex = new RegExp(dashedName, 'i');
      if (currentHike && filterRegex.test(currentHike.dashedName)) {
        return {
          hikes: [],
          isPrimed: true,
          dashedName
        };
      }
      return {
        hikes,
        isPrimed: false,
        dashedName: dashedName
      };
    }
  },
  stampit(React, {
    displayName: 'Lecture',

    propTypes: {
      params: PropTypes.object,
      currentHike: PropTypes.object
    },

    handleError: debug,

    handleFinish() {
      debug('loading questions');
      const { dashedName } = this.props.params;
      this.transitionTo(`/hikes/${dashedName}/questions/1`);
    },

    renderTranscript(transcript) {
      return transcript.map((line, index) => (
          <p key={ index }>{ line }</p>
        )
      );
    },

    render() {
      const {
        title,
        challengeSeed = ['1'],
        description = []
      } = this.props.currentHike;

      const [ id ] = challengeSeed;

      const videoTitle = <h2>{ title }</h2>;
      return (
        <Col xs={ 12 }>
          <Row>
            <Panel className={ 'text-center' } title={ videoTitle }>
              <Vimeo
                onError={ this.handleError }
                onFinish= { ::this.handleFinish }
                videoId={ id } />
            </Panel>
          </Row>
          <Row>
            <Col xs={ 12 }>
              <Panel>
                <p>
                  { this.renderTranscript(description) }
                </p>
              </Panel>
              <Panel>
                <Button
                  block={ true }
                  bsSize='large'
                  onClick={ ::this.handleFinish }>
                  Take me to the Questions
                </Button>
              </Panel>
            </Col>
          </Row>
        </Col>
      );
    }
  }).compose(Navigation)
);
{'fraction_non_alphanumeric': 0.12918060200668896, 'fraction_numerical': 0.0033444816053511705, 'mean_word_length': 1.580906148867314, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, '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': '3622816', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1351, 'n_words': 308}