<commit_before>import React from 'react';

import { Table, Pagination } from 'react-bootstrap';

export default class TasksTable extends React.Component {

  renderHeaders() {
    let row = this.props.headers.map((h, i) => {
      return <th key={i}>{h}</th>;
    });
    return <tr>{row}</tr>;
  }

  renderTableRows() {
    const rows = this.props.data.map((e, i) => {
      return this.props.renderTableRow(e, i);
    });
    return rows;
  }

  renderPagination() {
    if (this.props.paginate) {
      return (
        <div className="pagination-container">
          <Pagination
            prev
            next
            maxButtons={1}
            ellipsis={false}
            activePage={this.props.page}
            items={this.props.page + (this.props.disableNext ? 0 : 1)}
            onSelect={(event, selectedEvent) => this.props.onPage(selectedEvent.eventKey)} />
        </div>
      );
    }
  }

  renderTable() {
    // if (!this.props.loading) {
    //   return (
    //     <div>
    //       <Table responsive striped>
    //         <thead>
    //           {this.renderHeaders()}
    //         </thead>
    //         <tbody>
    //           {this.renderTableRows()}
    //         </tbody>
    //       </Table>
    //     </div>
    //   );
    // } else {
    //   return (
    //     <div className="text-center">
    //       <div className="page-loader"></div>
    //     </div>
    //   );
    // }

    /* Revisit that (shrinking issue) */
    return (
      <div>
        <Table responsive striped>
          <thead>
            {this.renderHeaders()}
          </thead>
          <tbody>
            {this.renderTableRows()}
          </tbody>
        </Table>
      </div>
    );
  }

  render() {
    if (this.props.data.length) {
      return (
        <div className="table-container">
          {this.renderTable()}
          {this.renderPagination()}<commit_msg>Remove comment block<commit_after>import React from 'react';

import { Table, Pagination } from 'react-bootstrap';

export default class TasksTable extends React.Component {

  renderHeaders() {
    let row = this.props.headers.map((h, i) => {
      return <th key={i}>{h}</th>;
    });
    return <tr>{row}</tr>;
  }

  renderTableRows() {
    const rows = this.props.data.map((e, i) => {
      return this.props.renderTableRow(e, i);
    });
    return rows;
  }

  renderPagination() {
    if (this.props.paginate) {
      return (
        <div className="pagination-container">
          <Pagination
            prev
            next
            maxButtons={1}
            ellipsis={false}
            activePage={this.props.page}
            items={this.props.page + (this.props.disableNext ? 0 : 1)}
            onSelect={(event, selectedEvent) => this.props.onPage(selectedEvent.eventKey)} />
        </div>
      );
    }
  }

  renderTable() {
    return (
      <div>
        <Table responsive striped>
          <thead>
            {this.renderHeaders()}
          </thead>
          <tbody>
            {this.renderTableRows()}
          </tbody>
        </Table>
      </div>
    );
  }

  render() {
    if (this.props.data.length) {
      return (
        <div className="table-container">
          {this.renderTable()}
          {this.renderPagination()}
{'fraction_non_alphanumeric': 0.15593530668294173, 'fraction_numerical': 0.00183094293561184, 'mean_word_length': 1.635048231511254, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 53, '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': '5708710', 'n_tokens_mistral': 1014, 'n_tokens_neox': 1003, 'n_words': 181}