<commit_before>import React, {PropTypes} from "react";
import Moment from "moment";
import HistoryItem from "./HistoryItem.jsx";
import HistoryHead from "./HistoryHead.jsx";

class History extends React.Component {
    constructor(props) {
        super(props);
    }

    getItems() {
        if (parseInt(this.props.paginate.limit) === 0) {
            return this.props.items;
        }
        const cursor = this.props.paginate.page * this.props.paginate.limit;
        return this.props.items.slice(cursor, parseInt(cursor)+parseInt(this.props.paginate.limit));
    }

    render() {
        const items = this.getItems();
        const selectedDay = Moment(this.props.date);

        let formattedTitle = "";
        if (this.props.query !== "") {
            formattedTitle += "Searching: \"" + this.props.query + "\" on ";
        }
        formattedTitle += selectedDay.format("dddd, MMM Do YY'");

        return (
            <div className="history list-group">
                <HistoryHead title={formattedTitle} />
                {items.map(obj => {
                    return <HistoryItem
                            key={obj.id}
                            info={obj}
                            stale={obj.lastVisitTime > selectedDay.endOf("day").valueOf() ? true : false} />
                })}
            </div>
        );
    }
}

export default History;<commit_msg>Change results header title depending on search type<commit_after>import React, {PropTypes} from "react";
import Moment from "moment";
import HistoryItem from "./HistoryItem.jsx";
import HistoryHead from "./HistoryHead.jsx";

class History extends React.Component {
    constructor(props) {
        super(props);
    }

    getItems() {
        if (parseInt(this.props.paginate.limit) === 0) {
            return this.props.items;
        }
        const cursor = this.props.paginate.page * this.props.paginate.limit;
        return this.props.items.slice(cursor, parseInt(cursor)+parseInt(this.props.paginate.limit));
    }

    render() {
        const items = this.getItems();
        const selectedDay = Moment(this.props.date);

        let formattedTitle = "";
        if (this.props.query !== "") {
            formattedTitle += "Searching: \"" + this.props.query + "\"";
            if (this.props.date) {
                formattedTitle += " on ";
            }
        }
        if (this.props.date) {
            formattedTitle += selectedDay.format("dddd, MMM Do YY'");
        }

        return (
            <div className="history list-group">
                <HistoryHead title={formattedTitle || "All visits"} />
                {items.map(obj => {
                    return <HistoryItem
                            key={obj.id}
                            info={obj}
                            stale={obj.lastVisitTime > selectedDay.endOf("day").valueOf() ? true : false} />
                })}
            </div>
        );
    }
}

export default History;
{'fraction_non_alphanumeric': 0.13254637436762226, 'fraction_numerical': 0.0006745362563237774, 'mean_word_length': 1.787593984962406, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '2236842', 'n_tokens_mistral': 817, 'n_tokens_neox': 792, 'n_words': 163}