<commit_before>import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Form} from 'semantic-ui-react';

export default class EntryInputContainer extends Component {
    static propTypes = {
        label: PropTypes.string,
        actionAddEntryToState: PropTypes.func.isRequired,
        actionRemoveEntryFromState: PropTypes.func.isRequired,
        entries: PropTypes.array.isRequired,
        placeholder: PropTypes.string,
        buttonIcon: PropTypes.string,
        disabled: PropTypes.bool,
    };

    constructor(props) {
        super(props);

        this.state = {
            value: '',
        };

        this.handleAdd = this.handleAdd.bind(this);

    }

    handleAdd(event) {
        event.preventDefault();

        if (this.state.value === '') {
            return;
        }

        this.props.actionAddEntryToState(this.state.value);
        this.setState({
            value: '',
        })
    }
<commit_msg>Prevent adding empty entries to EntryInputContainer #2<commit_after>import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Form} from 'semantic-ui-react';

export default class EntryInputContainer extends Component {
    static propTypes = {
        label: PropTypes.string,
        actionAddEntryToState: PropTypes.func.isRequired,
        actionRemoveEntryFromState: PropTypes.func.isRequired,
        entries: PropTypes.array.isRequired,
        placeholder: PropTypes.string,
        buttonIcon: PropTypes.string,
        disabled: PropTypes.bool,
    };

    constructor(props) {
        super(props);

        this.state = {
            value: '',
        };

        this.handleAdd = this.handleAdd.bind(this);

    }

    handleAdd(event) {
        event.preventDefault();

        if (this.state.value.trim() === '') {
            return;
        }

        this.props.actionAddEntryToState(this.state.value);
        this.setState({
            value: '',
        })
    }

{'fraction_non_alphanumeric': 0.11133603238866396, 'fraction_numerical': 0.0005060728744939271, 'mean_word_length': 2.284053156146179, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1542180', 'n_tokens_mistral': 532, 'n_tokens_neox': 537, 'n_words': 104}