<commit_before>import { Link } from 'react-router'

import { React, SubmissionBase } from '../base_components'


export default class SubmissionNav extends SubmissionBase {
    render() {
        const { tabbed } = this.props

        var steps = []
        const s = this.props.steps
        if (s) {
            var baseUri = this.baseUri()
            s.forEach((v) => {
                var destPath = `${baseUri}/${v.key}`
                var active = (this.props.location.pathname.substr(0, destPath.length) == destPath)
                if (!tabbed) {
                    var linkCls = 'list-group-item' + (active? ' active' : '')
                    steps.push(<Link key={v.key} className={linkCls} to={destPath}>{v.name}</Link>)
                } else {
                    steps.push(
                        <li key={v.key} role="presentation" className={active? 'active' : ''}>
                            <Link to={destPath}>{v.name}</Link>
                        </li>
                    )
                }
            })
        }
        if (tabbed) {
            return (
                <ul className="nav nav-tabs submission-nav">
                    {steps}
                </ul>
            )
        } else {
            return (
                <div className="list-group submission-nav">
                    {steps}
                </div>
            )
        }
    }
}<commit_msg>clean up nav rendering to be more es6-ish<commit_after>import { Link } from 'react-router'

import { React, SubmissionBase } from '../base_components'


export default class SubmissionNav extends SubmissionBase {
    render() {
        const { tabbed, location, steps } = this.props

        let outSteps = []
        if (steps) {
            var baseUri = this.baseUri()
            steps.forEach((v) => {
                const destPath = `${baseUri}/${v.key}`
                const active = (location.pathname.substr(0, destPath.length) == destPath)
                if (!tabbed) {
                    const linkCls = 'list-group-item' + (active? ' active' : '')
                    outSteps.push(<Link key={v.key} className={linkCls} to={destPath}>{v.name}</Link>)
                } else {
                    outSteps.push(
                        <li key={v.key} role="presentation" className={active? 'active' : ''}>
                            <Link to={destPath}>{v.name}</Link>
                        </li>
                    )
                }
            })
        }
        if (tabbed) {
            return (
                <ul className="nav nav-tabs submission-nav">
                    {outSteps}
                </ul>
            )
        } else {
            return (
                <div className="list-group submission-nav">
                    {outSteps}
                </div>
            )
        }
    }
}
{'fraction_non_alphanumeric': 0.12878254750175933, 'fraction_numerical': 0.001055594651653765, 'mean_word_length': 1.1953667953667955, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '7056748', 'n_tokens_mistral': 779, 'n_tokens_neox': 741, 'n_words': 156}