<commit_before>import React from "react";
import { connect } from "react-redux";
import styled from "styled-components";
import { pushState } from "../../app/actions";
import { Button, Modal, ModalBody, ModalHeader } from "../../base";
import { routerLocationHasState } from "../../utils/utils";
import { postDevCommand } from "../actions";

export const DeveloperCommand = styled(ModalBody)`
    align-items: center;
    display: flex;
    padding: 15px;
`;

export const DeveloperCommandLabel = styled.div`
    h3 {
        margin: 0 0 5px;
    }

    p {
        margin: 0;
    }
`;

export const DeveloperCommandControl = styled.div`
    margin-left: auto;
`;

export const DeveloperDialog = ({ show, onCommand, onHide }) => (
    <Modal label="Developer" show={show} size="lg" onHide={onHide}>
        <ModalHeader>Developer</ModalHeader>
        <DeveloperCommand>
            <DeveloperCommandLabel>
                <h3>Clear Users</h3>
                <p>Remove existing users. You will be required to create a first user.</p>
            </DeveloperCommandLabel>
            <DeveloperCommandControl>
                <Button color="red" onClick={() => onCommand("clear_users")}>
                    Clear Users
                </Button>
            </DeveloperCommandControl>
        </DeveloperCommand>
    </Modal>
);

export const mapStateToProps = state => ({
    show: routerLocationHasState(state, "devCommands")
});

export const mapDispatchToProps = dispatch => ({
    onCommand: command => {
        dispatch(postDevCommand(command));
    },

    onHide: () => {<commit_msg>Add UI for creating fake subtractions<commit_after>import React from "react";
import { connect } from "react-redux";
import styled from "styled-components";
import { pushState } from "../../app/actions";
import { Button, Modal, ModalBody, ModalHeader } from "../../base";
import { routerLocationHasState } from "../../utils/utils";
import { postDevCommand } from "../actions";

export const DeveloperCommand = styled(ModalBody)`
    align-items: center;
    display: flex;
    padding: 15px;
`;

export const DeveloperCommandLabel = styled.div`
    h3 {
        margin: 0 0 5px;
    }

    p {
        margin: 0;
    }
`;

export const DeveloperCommandControl = styled.div`
    margin-left: auto;
`;

export const DeveloperDialog = ({ show, onCommand, onHide }) => (
    <Modal label="Developer" show={show} size="lg" onHide={onHide}>
        <ModalHeader>Developer</ModalHeader>
        <DeveloperCommand>
            <DeveloperCommandLabel>
                <h3>Clear Users</h3>
                <p>Remove existing users. You will be required to create a first user.</p>
            </DeveloperCommandLabel>
            <DeveloperCommandControl>
                <Button color="red" onClick={() => onCommand("clear_users")}>
                    Clear Users
                </Button>
            </DeveloperCommandControl>
        </DeveloperCommand>
        <DeveloperCommand>
            <DeveloperCommandLabel>
                <h3>Create Subtraction</h3>
                <p>Creates a subtraction that is ready for use.</p>
            </DeveloperCommandLabel>
            <DeveloperCommandControl>
                <Button color="red" onClick={() => onCommand("create_subtraction")}>
                    Create Subtraction
                </Button>
            </DeveloperCommandControl>
        </DeveloperCommand>
    </Modal>
);

export const mapStateToProps = state => ({
    show: routerLocationHasState(state, "devCommands")
});

export const mapDispatchToProps = dispatch => ({
    onCommand: command => {
        dispatch(postDevCommand(command));
    },

    onHide: () => {
{'fraction_non_alphanumeric': 0.12761904761904763, 'fraction_numerical': 0.005442176870748299, 'mean_word_length': 2.4777672658467362, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5921737', 'n_tokens_mistral': 1050, 'n_tokens_neox': 975, 'n_words': 256}