<commit_before>import Webiny from 'Webiny';
const Ui = Webiny.Ui.Components;

class Action extends Webiny.Ui.Component {

}

Action.defaultProps = {
    onClick: _.noop,
    download: null,
    renderer() {
        if (_.isFunction(this.props.children)) {
            return this.props.children.call(this, this.props.data, this);
        }

        if (this.props.download) {
            return (
                <Ui.DownloadLink download={this.props.download} data={this.props.data}>{this.props.label}</Ui.DownloadLink>
            );
        }

        return (
            <Ui.Link
                data={this.props.data}
                onClick={() => this.props.onClick.call(this, this.props.data, this)}
                title={this.props.label}/>
        );
    }
};

export default Action;<commit_msg>Added icon handling to Action class<commit_after>import Webiny from 'Webiny';
const Ui = Webiny.Ui.Components;

class Action extends Webiny.Ui.Component {

}

Action.defaultProps = {
    icon: null,
    onClick: _.noop,
    download: null,
    renderer() {
        if (_.isFunction(this.props.children)) {
            return this.props.children.call(this, this.props.data, this);
        }

        const icon = this.props.icon ? <Ui.Icon icon={this.props.icon}/> : null;

        if (this.props.download) {
            return (
                <Ui.DownloadLink download={this.props.download} data={this.props.data}>{icon} {this.props.label}</Ui.DownloadLink>
            );
        }

        return (
            <Ui.Link
                data={this.props.data}
                onClick={() => this.props.onClick.call(this, this.props.data, this)}>
                {icon} {this.props.label}
            </Ui.Link>
        );
    }
};

export default Action;
{'fraction_non_alphanumeric': 0.1388888888888889, 'fraction_numerical': 0.0, 'mean_word_length': 1.9416666666666667, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6717686', 'n_tokens_mistral': 534, 'n_tokens_neox': 531, 'n_words': 95}