<commit_before>import React from 'react';
import {List, Label, Icon, Button, Grid} from 'semantic-ui-react';

class DigestItem extends React.Component {

    constructor(props) {
        super(props);

        this.state = {
            deleteConfirm: false,
            deleteInProgress: false
        };
    }

    static get propTypes() {
        return {
            path: React.PropTypes.string,
            name: React.PropTypes.string,
            tags: React.PropTypes.arrayOf(React.PropTypes.string),
            deleteTag: React.PropTypes.func
        };
    }

    onDeleteClick() {
        // if (confirm(`Destroy tag: ${path}:${tag}?`)) {
        //     this.props.deleteTag(path, tag);
        // }

        this.setState({deleteConfirm: true});
    }

    onCancelClick() {
        this.setState({deleteConfirm: false});
    }

    onConfirmClick(path, tag) {
        this.setState({deleteInProgress: true});

        setTimeout(() => {
            this.setState({
                deleteInProgress: false,
                deleteConfirm: false
            });
        }, 4000);
    }

    render() {
        return (
            <List.Item>
                <List.Content>
                    <Grid columns={2}>
                        <Grid.Column width={13}>
                            <Label.Group color="blue" size="tiny">
                                {this.props.tags.map(tag => <Label key={tag}><Icon name="tag" />{tag}</Label>)}
                            </Label.Group>
                            <List.Description>{this.props.name}</List.Description>
                        </Grid.Column>
                        <Grid.Column width={2}>
                            {!this.state.deleteConfirm
                                ? <Button onClick={this.onDeleteClick.bind(this)} color="red" icon="delete" size="mini" />
                                : <Button.Group size="tiny">
                                    <Button disabled={this.state.deleteInProgress}
                                            onClick={this.onCancelClick.bind(this)}>
                                        Cancel
                                    </Button>
                                    <Button.Or />
                                    <Button loading={this.state.deleteInProgress}
                                            onClick={this.onConfirmClick.bind(this, this.props.path, this.props.name)}
                                            color="red">
                                        Delete
                                    </Button>
                                </Button.Group>}
                        </Grid.Column>
                    </Grid>
                </List.Content>
            </List.Item>
        );
    }

}

export default DigestItem;<commit_msg>remove grid from digest item<commit_after>import React from 'react';
import {List, Label, Icon, Button} from 'semantic-ui-react';

class DigestItem extends React.Component {

    constructor(props) {
        super(props);

        this.state = {
            deleteConfirm: false,
            deleteInProgress: false
        };
    }

    static get propTypes() {
        return {
            path: React.PropTypes.string,
            name: React.PropTypes.string,
            tags: React.PropTypes.arrayOf(React.PropTypes.string),
            deleteTag: React.PropTypes.func
        };
    }

    onDeleteClick() {
        this.setState({deleteConfirm: true});
    }

    onCancelClick() {
        this.setState({deleteConfirm: false});
    }

    onConfirmClick(path, tag) {
        this.setState({deleteInProgress: true});

        setTimeout(() => {
            this.setState({
                deleteInProgress: false,
                deleteConfirm: false
            });
        }, 4000);

        // this.props.deleteTag(path, tag);
    }

    render() {
        return (
            <List.Item active={this.state.deleteConfirm}>
                    <List.Content floated="right">
                        {!this.state.deleteConfirm
                            ? <Button onClick={this.onDeleteClick.bind(this)} color="red" icon="delete" size="mini" />
                            : <Button.Group size="tiny">
                                <Button disabled={this.state.deleteInProgress}
                                        onClick={this.onCancelClick.bind(this)}>
                                    Cancel
                                </Button>
                                <Button.Or />
                                <Button loading={this.state.deleteInProgress}
                                        onClick={this.onConfirmClick.bind(this, this.props.path, this.props.name)}
                                        color="red">
                                    Delete
                                </Button>
                            </Button.Group>}
                    </List.Content>
                    <List.Content>
                        <Label.Group color="blue" size="tiny">
                            {this.props.tags.map(tag => <Label key={tag}><Icon name="tag" />{tag}</Label>)}
                        </Label.Group>
                        <List.Description>{this.props.name}</List.Description>
                    </List.Content>
            </List.Item>
        );
    }

}

export default DigestItem;
{'fraction_non_alphanumeric': 0.11501776697213391, 'fraction_numerical': 0.0022442491116513932, 'mean_word_length': 1.126441351888668, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6098048', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1234, 'n_words': 211}