<commit_before>import React, { Component, PropTypes } from 'react'
import radium from 'radium'
import { base } from '../styles'
import MdChevronLeft from 'react-icons/lib/md/chevron-left'
import MdExpandMore from 'react-icons/lib/md/expand-more'

/*
    The Folder is a container component that can be toggled opened and closed.
    To render it's children, it takes an function that returns an array of react
    elements.
*/

class Folder extends Component {

    constructor(){

        super()

        this.state = { open: false }

        this.toggleOpen = _ => this.setState({ open:!this.state.open })

    }


    render(){

        let { label, value } = this.props,
            { open } = this.state

        return <div style={base}>
            <div onClick={this.toggleOpen}>{ label }{ open ? <MdExpandMore style={floatRight}/> : <MdChevronLeft style={floatRight}/> }</div>
            { open ? <div>{ value() }</div> : null }
        </div>

    }
}


Folder.defaultProps = {

    label: 'Folder',
    onChange: a=>a

}


Folder.propTypes = {

    value : PropTypes.func.isRequired,
<commit_msg>Folder Comp now supports styling<commit_after>import React, { Component, PropTypes } from 'react'
import radium from 'radium'
import { base } from '../styles'
import MdChevronLeft from 'react-icons/lib/md/chevron-left'
import MdExpandMore from 'react-icons/lib/md/expand-more'

/*
    The Folder is a container component that can be toggled opened and closed.
    To render it's children, it takes an function that returns an array of react
    elements.
*/

class Folder extends Component {

    constructor(){

        super()

        this.state = { open: false }

        this.toggleOpen = _ => this.setState({ open:!this.state.open })

    }


    render(){

        let { label, value } = this.props,
            { open } = this.state

        return <div style={[base, style]}>
            <div onClick={this.toggleOpen}>{ label }{ open ? <MdExpandMore style={floatRight}/> : <MdChevronLeft style={floatRight}/> }</div>
            { open ? <div>{ value() }</div> : null }
        </div>

    }
}


Folder = radium( Folder )


Folder.defaultProps = {

    label: 'Folder',
    onChange: a=>a

}


Folder.propTypes = {

    value : PropTypes.func.isRequired,

{'fraction_non_alphanumeric': 0.1310466138962181, 'fraction_numerical': 0.0, 'mean_word_length': 2.616852146263911, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '2201121', 'n_tokens_mistral': 717, 'n_tokens_neox': 684, 'n_words': 198}