<commit_before>/**
 * Copyright 2015, GeoSolutions Sas.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

const React = require('react');
const {Pager, PageItem} = require('react-bootstrap');

var Book = React.createClass({
    propTypes: {
        currentPage: React.PropTypes.number,
        pageTitles: React.PropTypes.array
    },
    getDefaultProps() {
        return {
            currentPage: 0,
            pageTitles: []
        };
    },
    getInitialState() {
        return {
            currentPage: this.props.currentPage
        };
    },
    getPageNumber() {
        return this.props.children ? ((this.state.currentPage + 1) + "/" + this.props.children.length) : null;
    },
    renderTitle() {
        let title;
        if (this.props.pageTitles.length > 0 && this.state.currentPage < this.props.pageTitles.length) {
            title = this.props.pageTitles[this.state.currentPage];
        } else {
            title = null;
        }
        return title;
    },
    renderBody() {
        let body;
        if (this.props.children && this.props.children.length > 0 && this.state.currentPage < this.props.children.length) {
            body = React.cloneElement(this.props.children[this.state.currentPage]);
        } else {
            body = null;
        }
        return body;
    },
    render() {
        return (
            <div>
                <div style={{textAlign: "center", marginBottom: "12px"}}>
                    {this.renderTitle()}
                </div>
                <div>
                    {this.renderBody()}
                </div>
                <Pager>
                    <PageItem previous<commit_msg>added overflow style rule<commit_after>/**
 * Copyright 2015, GeoSolutions Sas.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 */

const React = require('react');
const {Pager, PageItem} = require('react-bootstrap');

var Book = React.createClass({
    propTypes: {
        currentPage: React.PropTypes.number,
        pageTitles: React.PropTypes.array
    },
    getDefaultProps() {
        return {
            currentPage: 0,
            pageTitles: []
        };
    },
    getInitialState() {
        return {
            currentPage: this.props.currentPage
        };
    },
    getPageNumber() {
        return this.props.children ? ((this.state.currentPage + 1) + "/" + this.props.children.length) : null;
    },
    renderTitle() {
        let title;
        if (this.props.pageTitles.length > 0 && this.state.currentPage < this.props.pageTitles.length) {
            title = this.props.pageTitles[this.state.currentPage];
        } else {
            title = null;
        }
        return title;
    },
    renderBody() {
        let body;
        if (this.props.children && this.props.children.length > 0 && this.state.currentPage < this.props.children.length) {
            body = React.cloneElement(this.props.children[this.state.currentPage]);
        } else {
            body = null;
        }
        return body;
    },
    render() {
        return (
            <div>
                <div style={{textAlign: "center", marginBottom: "12px"}}>
                    {this.renderTitle()}
                </div>
                <div style={{overflow: "auto"}}>
                    {this.renderBody()}
                </div>
                <Pager>
                    <PageItem previous
{'fraction_non_alphanumeric': 0.12259682362775147, 'fraction_numerical': 0.005572582892170521, 'mean_word_length': 1.736280487804878, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '1540594', 'n_tokens_mistral': 1028, 'n_tokens_neox': 998, 'n_words': 220}