<commit_before>import React, { Component } from 'react';
import { Accordion, AccordionItem } from 'react-sanfona';

import AccordionStyles from '../../../styles/components/shared/c-content-accordion.scss';

class ContentAccordion extends Component {

  constructor(props) {
    super(props);
    this.state = {
      isOpen: false
    };

    this.toggleItemBound = this.toggleItem.bind(this);
  }

  getAccordionItems() {
    const entries = this.props.entries;
    const accordionItems = [];

    for (let index = 0; index < entries.length; index++) {
      accordionItems.push(
        <AccordionItem
          key={index}
          title={entries[index].title}
          className={AccordionStyles['accordion-item']}
          titleClassName={AccordionStyles['item-title']}
        >
          <article className={AccordionStyles['item-answer']}>
            <p
              dangerouslySetInnerHTML={{
                __html: entries[index].content
              }}
            />
          </article>
        </AccordionItem>
      );
    }

    return accordionItems;
  }

  // changes arrow's direction when open and close
  // we are not using it right now because we are not
  // implementing the arrows. We'll do in a nerby future.
  toggleItem() {
    this.setState({ isOpen: !this.state.isOpen });
  }

  render() {
    return (
      <Accordion
        allowMultiple={false}
        activeItems={0}
        className={AccordionStyles['c-content-accordion']}
        onChange={this.toggleItemBound}
      >
        {this.getAccordionItems()}
      </Accordion>
    );
  }
}
<commit_msg>closed accordion items by default<commit_after>import React, { Component } from 'react';
import { Accordion, AccordionItem } from 'react-sanfona';

import AccordionStyles from '../../../styles/components/shared/c-content-accordion.scss';

class ContentAccordion extends Component {

  constructor(props) {
    super(props);
    this.state = {
      isOpen: false
    };

    this.toggleItemBound = this.toggleItem.bind(this);
  }

  getAccordionItems() {
    const entries = this.props.entries;
    const accordionItems = [];

    for (let index = 0; index < entries.length; index++) {
      accordionItems.push(
        <AccordionItem
          key={index}
          title={entries[index].title}
          className={AccordionStyles['accordion-item']}
          titleClassName={AccordionStyles['item-title']}
        >
          <article className={AccordionStyles['item-answer']}>
            <p
              dangerouslySetInnerHTML={{
                __html: entries[index].content
              }}
            />
          </article>
        </AccordionItem>
      );
    }

    return accordionItems;
  }

  // changes arrow's direction when open and close
  // we are not using it right now because we are not
  // implementing the arrows. We'll do in a nerby future.
  toggleItem() {
    this.setState({ isOpen: !this.state.isOpen });
  }

  render() {
    return (
      <Accordion
        allowMultiple={false}
        activeItems={-1}
        className={AccordionStyles['c-content-accordion']}
        onChange={this.toggleItemBound}
      >
        {this.getAccordionItems()}
      </Accordion>
    );
  }
}

{'fraction_non_alphanumeric': 0.1239515377446412, 'fraction_numerical': 0.0012426219322771047, 'mean_word_length': 2.2991803278688523, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '6605145', 'n_tokens_mistral': 955, 'n_tokens_neox': 944, 'n_words': 192}