<commit_before>import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { isString } from 'lodash/lang';
import { component as ConfirmationModal } from '../../application/confirmation-popin';
import connect from '../../behaviours/store/connect';
import application from 'focus-core/application';

const { builtInStore: applicationStore } = application;

const propTypes = {
    isVisible: PropTypes.bool,
    ConfirmContentComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
    handleCancel: PropTypes.func,
    handleConfirm: PropTypes.func
};

const defaultProps = {
    isVisible: false,
    ConfirmContentComponent: null
};

const connector = connect(
    [{
        store: applicationStore,
        properties: ['confirmConfig']
    }],
    () => {
        const {
            isVisible = false,
            Content: ConfirmContentComponent = null,
            handleCancel: cancelHandler,
            handleConfirm: confirmHandler,
            ...contentProps
        } = applicationStore.getConfirmConfig() || {};

        return { isVisible, ConfirmContentComponent, cancelHandler, confirmHandler, contentProps };
    }
)

const ConfirmWrapper = () => {
    const { isVisible, ConfirmContentComponent, cancelHandler, confirmHandler, contentProps } = this.props;
    const ConfirmContent = isString(ConfirmContentComponent)
        ? () => (<span>{ConfirmContentComponent}</span>)
        : ConfirmContentComponent;

    return isVisible ? (
        <ConfirmationModal
            open
            cancelHandler={cancelHandler}
            confirmHandler={confirmHandler}
            {...contentProps}
        >
            {ConfirmContent ? (<ConfirmContent />) : null}
        </ConfirmationModal>
    ) : null;
}

ConfirmWrapper.propTypes = propTypes;
ConfirmWrapper.defaultProps = defaultProps;
ConfirmWrapper.displayName = 'ConfirmWrapper';

export default connector(ConfirmWrapper);
<commit_msg>fix review for confirm<commit_after>import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { isString } from 'lodash/lang';
import { component as ConfirmationModal } from '../../application/confirmation-popin';
import connect from '../../behaviours/store/connect';
import { builtInStore as applicationStore } from 'focus-core/application';

const propTypes = {
    isVisible: PropTypes.bool,
    ConfirmContentComponent: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
    handleCancel: PropTypes.func,
    handleConfirm: PropTypes.func
};

const defaultProps = {
    isVisible: false,
    ConfirmContentComponent: null
};

const connector = connect(
    [{
        store: applicationStore,
        properties: ['confirmConfig']
    }],
    () => {
        const {
            isVisible = false,
            Content: ConfirmContentComponent = null,
            handleCancel: cancelHandler,
            handleConfirm: confirmHandler,
            ...contentProps
        } = applicationStore.getConfirmConfig() || {};

        return { isVisible, ConfirmContentComponent, cancelHandler, confirmHandler, contentProps };
    }
)

const ConfirmWrapper = () => {
    const { isVisible, ConfirmContentComponent, cancelHandler, confirmHandler, contentProps } = this.props;
    const ConfirmContent = isString(ConfirmContentComponent)
        ? () => (<span>{ConfirmContentComponent}</span>)
        : ConfirmContentComponent;

    return isVisible ? (
        <ConfirmationModal
            open
            cancelHandler={cancelHandler}
            confirmHandler={confirmHandler}
            {...contentProps}
        >
            {ConfirmContent ? (<ConfirmContent />) : null}
        </ConfirmationModal>
    ) : null;
}

ConfirmWrapper.propTypes = propTypes;
ConfirmWrapper.defaultProps = defaultProps;
ConfirmWrapper.displayName = 'ConfirmWrapper';

export default connector(ConfirmWrapper);

{'fraction_non_alphanumeric': 0.10843373493975904, 'fraction_numerical': 0.0, 'mean_word_length': 3.151063829787234, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '4603176', 'n_tokens_mistral': 979, 'n_tokens_neox': 976, 'n_words': 219}