<commit_before>/* eslint-disable react/jsx-no-bind */
import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import {FormattedMessage} from 'react-intl';

import {selectStudioOpenToAll, selectIsFetchingInfo} from '../../redux/studio';
import {
    mutateStudioOpenToAll, selectIsMutatingOpenToAll, selectOpenToAllMutationError
} from '../../redux/studio-mutations';

const ToggleSlider = require('../../components/forms/toggle-slider.jsx');

const StudioOpenToAll = ({
    openToAllError, isFetching, isMutating, openToAll, handleUpdate
}) => (
    <div>
        {isFetching ? (
            <h4>Fetching...</h4>
        ) : (
            <div>
                <FormattedMessage id="studio.openToAll" />
                <ToggleSlider
                    disabled={isMutating}
                    checked={openToAll}
                    className="open-to-all-input"
                    onChange={e => handleUpdate(e.target.checked)}
                />
                {openToAllError && <div>Error mutating openToAll: {openToAllError}</div>}
            </div>
        )}
    </div>
);

StudioOpenToAll.propTypes = {
    openToAllError: PropTypes.string,
    isFetching: PropTypes.bool,
    isMutating: PropTypes.bool,
    openToAll: PropTypes.bool,
    handleUpdate: PropTypes.func
};
<commit_msg>add mutating css class for project toggle and fix imports<commit_after>/* eslint-disable react/jsx-no-bind */
import React from 'react';
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import {FormattedMessage} from 'react-intl';
import classNames from 'classnames';

import {selectStudioOpenToAll, selectIsFetchingInfo} from '../../redux/studio';
import {
    mutateStudioOpenToAll, selectIsMutatingOpenToAll, selectOpenToAllMutationError
} from '../../redux/studio-mutations';

import ToggleSlider from '../../components/forms/toggle-slider.jsx';

const StudioOpenToAll = ({
    openToAllError, isFetching, isMutating, openToAll, handleUpdate
}) => (
    <div>
        {isFetching ? (
            <h4>Fetching...</h4>
        ) : (
            <div>
                <FormattedMessage id="studio.openToAll" />
                <ToggleSlider
                    disabled={isMutating}
                    checked={openToAll}
                    className={classNames('open-to-all-input', {
                        'mod-mutating': isMutating
                    })}
                    onChange={e => handleUpdate(e.target.checked)}
                />
                {openToAllError && <div>Error mutating openToAll: {openToAllError}</div>}
            </div>
        )}
    </div>
);

StudioOpenToAll.propTypes = {
    openToAllError: PropTypes.string,
    isFetching: PropTypes.bool,
    isMutating: PropTypes.bool,
    openToAll: PropTypes.bool,
    handleUpdate: PropTypes.func
};

{'fraction_non_alphanumeric': 0.12736842105263158, 'fraction_numerical': 0.0014035087719298245, 'mean_word_length': 2.3659976387249113, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, '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': '1675616', 'n_tokens_mistral': 843, 'n_tokens_neox': 850, 'n_words': 156}