<commit_before>import { connect } from 'react-redux';
import { getP } from './selectors';

const mapStateToProps = state => ({ p: getP(state) });
export const translate = connect(mapStateToProps);<commit_msg>translate enhancer : add displayName to the translated Component.<commit_after>import { connect } from 'react-redux';
import { getP } from './selectors';

const getDisplayName = WrappedComponent => (
    WrappedComponent.displayName || WrappedComponent.name || 'Component'
);

const mapStateToProps = state => ({ p: getP(state) });
export const translate = Component => {
    const Connected = connect(mapStateToProps)(Component);
    Connected.displayName = `Translated(${getDisplayName(Connected.WrappedComponent)})`;
    return Connected;
};
{'fraction_non_alphanumeric': 0.13297872340425532, 'fraction_numerical': 0.0, 'mean_word_length': 5.663716814159292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2047722', 'n_tokens_mistral': 212, 'n_tokens_neox': 208, 'n_words': 53}