<commit_before>import React from "react";
import { connect } from "react-redux";
import { push } from "react-router-redux";
import { LinkContainer } from "react-router-bootstrap";
import { Icon, Button } from "../../base";
import {createFindURL, getFindTerm} from "../../utils";

const OTUToolbar = ({ canModify, onFind, term, onFilter, search }) => (
    <div className="toolbar">
        <div className="form-group">
            <div className="input-group">
                <span id="find-addon" className="input-group-addon">
                    <Icon name="search" />
                </span>
                <input
                    aria-describedby="find-addon"
                    className="form-control"
                    type="text"
                    placeholder="Name or abbreviation"
                    value={term}
                    onChange={onFind}
                />
            </div>
        </div>

        <Button
            tip="Filter Unverified"
            onClick={() => onFilter(`${window.location.pathname}?verified=false`)}
            active={search === "?verified=false"}
        >
            <Icon name="filter" />
        </Button>

        {canModify ? (
            <LinkContainer to={{...window.location, state: {createOTU: true}}} replace>
                <Button bsStyle="primary" tip="Create">
                    <Icon name="plus-square" />
                </Button>
            </LinkContainer>
        ) : null}
    </div>
);

const mapStateToProps = (state) => ({
    term: getFindTerm(),
    search: state.router.location.search,
    canModify: state.account.administrator
});

const mapDispatchToProps = (dispatch) => ({

    onFind: (e) => {
        const url = createFindURL({ find: e.target.value });
        dispatch(push(url.pathname + url.search));
    },

    onFilter: (url) => {
        const currentUrl = window.location.pathname + window.location.search;
        if (currentUrl === url) {
            dispatch(push(window.location.pathname));
        } else {
            dispatch(push(url));
        }
    }

});

export default connect(mapStateToProps, mapDispatchToProps)(OTUToolbar);
<commit_msg>Hide create otu button<commit_after>import React from "react";
import { connect } from "react-redux";
import { push } from "react-router-redux";
import { LinkContainer } from "react-router-bootstrap";
import { Icon, Button } from "../../base";
import {createFindURL, getFindTerm} from "../../utils";

const OTUToolbar = ({ canModify, onFind, term, onFilter, search }) => (
    <div className="toolbar">
        <div className="form-group">
            <div className="input-group">
                <span id="find-addon" className="input-group-addon">
                    <Icon name="search" />
                </span>
                <input
                    aria-describedby="find-addon"
                    className="form-control"
                    type="text"
                    placeholder="Name or abbreviation"
                    value={term}
                    onChange={onFind}
                />
            </div>
        </div>

        <Button
            tip="Filter Unverified"
            onClick={() => onFilter(`${window.location.pathname}?verified=false`)}
            active={search === "?verified=false"}
        >
            <Icon name="filter" />
        </Button>

        {canModify ? (
            <LinkContainer to={{...window.location, state: {createOTU: true}}} replace>
                <Button bsStyle="primary" tip="Create">
                    <Icon name="plus-square" />
                </Button>
            </LinkContainer>
        ) : null}
    </div>
);

const mapStateToProps = (state) => ({
    term: getFindTerm(),
    search: state.router.location.search,
    canModify: (state.account.administrator && !state.references.detail.remotes_from)
});

const mapDispatchToProps = (dispatch) => ({

    onFind: (e) => {
        const url = createFindURL({ find: e.target.value });
        dispatch(push(url.pathname + url.search));
    },

    onFilter: (url) => {
        const currentUrl = window.location.pathname + window.location.search;
        if (currentUrl === url) {
            dispatch(push(window.location.pathname));
        } else {
            dispatch(push(url));
        }
    }

});

export default connect(mapStateToProps, mapDispatchToProps)(OTUToolbar);

{'fraction_non_alphanumeric': 0.14644160583941607, 'fraction_numerical': 0.0, 'mean_word_length': 1.9020516214427532, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 51, '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': '918874', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1185, 'n_words': 242}