<commit_before>'use strict'

const Icon = require('./icon.js.jsx')

const Accordion = React.createClass({

  propTypes: {
    title: React.PropTypes.string.isRequired,
  },

  getInitialState() {
    return {
      open: true
    }
  },

  render() {
    let content
    let chevron

    if (this.state.open) {
      content = <div className="px3">{this.props.children}</div>
    }

    if (this.state.open) {
      chevron = <Icon icon="chevron-up" />
    } else {
      chevron = <Icon icon="chevron-down" />
    }

    return (
      <div>
        <a className="pill block black black-hover pointer px3 py1 mb1 h5 mt0 mb0 bg-gray-5-hover" onClick={this.toggleOpen}>
          <div className="right gray-2">{chevron}</div>
          <strong>{this.props.title}</strong>
        </a>
        {content}
      </div>
    )
  },

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

module.exports = window.Accordion = Accordion<commit_msg>Make the accordions less obnoxious<commit_after>'use strict'

import Icon from './icon.js.jsx'

const Accordion = React.createClass({

  propTypes: {
    title: React.PropTypes.string.isRequired,
  },

  getInitialState() {
    return {
      open: true
    }
  },

  render() {
    let content = null,
        chevron = null

    if (this.state.open) {
      content = <div className="px3">{this.props.children}</div>
    }

    if (this.state.open) {
      chevron = <Icon icon="angle-up" />
    } else {
      chevron = <Icon icon="angle-down" />
    }

    return (
      <div>
        <a className="pill block black black-hover pointer px3 py1 mb1 h5 mt0 mb0 visible-hover-wrapper" onClick={this.toggleOpen}>
          <div className="visible-hover right gray-2">
            {chevron}
          </div>
          {this.props.title}
        </a>
        {content}
      </div>
    )
  },

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

export default Accordion
window.Accordion = Accordion
{'fraction_non_alphanumeric': 0.14583333333333334, 'fraction_numerical': 0.008638211382113821, 'mean_word_length': 2.2599337748344372, 'pattern_counts': {'":': 0, '<': 25, '<?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': '7655214', 'n_tokens_mistral': 680, 'n_tokens_neox': 659, 'n_words': 136}