<commit_before>import React from 'react'
import Button from './Button.js'
import PagesSelector from './PagesSelector.js'
import Search from './Search.js'
import styles from '../css/styles.css'

var CommonConstants = require('./CommonConstants');
var EditorConstants = require('./EditorConstants');

class Tools extends React.Component {
  render()
  {
    return (
      <div className="gt_head_tools">
        {// proccess buttons
          this.props.tableOpts.buttons.map((btn, i) => {
            if (btn[EditorConstants.EXTENDED] === EditorConstants.EDITOR_CREATE) {
              return <Button key={i}>New</Button>;
            }
            if (btn[EditorConstants.EXTENDED] === EditorConstants.EDITOR_EDIT) {
              return <Button key={i}>Edit</Button>;
            }
            if (btn[EditorConstants.EXTENDED] === EditorConstants.EDITOR_REMOVE) {
              return <Button key={i}>Delete</Button>;
            }
          })
        }
        <PagesSelector perPage={this.props.perPage} updatePerPage={this.props.updatePerPage}
          defaultPerPage={this.props.defaultPerPage}
          perPageRows={this.props.perPageRows} lang={this.props.lang} />
        <Search/>
        <div className={styles.clear}></div>
      </div>
    )
  }
}

export default Tools<commit_msg>	*	#4. add lang support<commit_after>import React from 'react'
import Button from './Button.js'
import PagesSelector from './PagesSelector.js'
import Search from './Search.js'
import styles from '../css/styles.css'

var CommonConstants = require('./CommonConstants');
var EditorConstants = require('./EditorConstants');
var Lang = require('./Lang');

class Tools extends React.Component {
  render()
  {
    var lang = Lang[this.props.lang];
    return (
      <div className="gt_head_tools">
        {// proccess buttons
          this.props.tableOpts.buttons.map((btn, i) => {
            if (btn[EditorConstants.EXTENDED] === EditorConstants.EDITOR_CREATE) {
              return <Button key={i}>{lang.editor_create}</Button>;
            }
            if (btn[EditorConstants.EXTENDED] === EditorConstants.EDITOR_EDIT) {
              return <Button key={i}>{lang.editor_edit}</Button>;
            }
            if (btn[EditorConstants.EXTENDED] === EditorConstants.EDITOR_REMOVE) {
              return <Button key={i}>{lang.editor_remove}</Button>;
            }
          })
        }
        <PagesSelector perPage={this.props.perPage} updatePerPage={this.props.updatePerPage}
          defaultPerPage={this.props.defaultPerPage}
          perPageRows={this.props.perPageRows} lang={this.props.lang} />
        <Search/>
        <div className={styles.clear}></div>
      </div>
    )
  }
}

export default Tools
{'fraction_non_alphanumeric': 0.13975726369988967, 'fraction_numerical': 0.0003677822728944465, 'mean_word_length': 2.617021276595745, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '1646096', 'n_tokens_mistral': 761, 'n_tokens_neox': 760, 'n_words': 147}