<commit_before>import { Cloud } from '@material-ui/icons';
import { IFeatureEnvironment } from '../../../../../../interfaces/featureToggle';
import { Switch } from '@material-ui/core';
import { useStyles } from './FeatureOverviewEnvironment.styles';
import FeatureOverviewStrategyCard from './FeatureOverviewStrategyCard/FeatureOverviewStrategyCard';
import classNames from 'classnames';
import ConditionallyRender from '../../../../../common/ConditionallyRender';
import useFeatureApi from '../../../../../../hooks/api/actions/useFeatureApi/useFeatureApi';
import { useHistory, useParams, Link } from 'react-router-dom';
import { IFeatureViewParams } from '../../../../../../interfaces/params';
import useToast from '../../../../../../hooks/useToast';

interface IFeatureOverviewEnvironmentProps {
    env: IFeatureEnvironment;
    refetch: () => void;
}

const FeatureOverviewEnvironment = ({
    env,
    refetch,
}: IFeatureOverviewEnvironmentProps) => {
    const { featureId, projectId } = useParams<IFeatureViewParams>();
    const { toggleFeatureEnvironmentOn, toggleFeatureEnvironmentOff } =
        useFeatureApi();
    const styles = useStyles();
    const { toast, setToastData } = useToast();
    const history = useHistory();

    console.log(env);

    const handleClick = () => {
        history.push(
            `/projects/${projectId}/features2/${featureId}/strategies?environment=${env.name}`
        );
    };

    const renderStrategies = () => {
        const { strategies } = env;

        return strategies.map(strategy => {
            return (
                <FeatureOverviewStrategyCard
                    strategy={strategy}
                    key={strategy.id}
                    onClick={handleClick}
                />
            );
        });
    };

    const handleToggleEnvironmentOn = async () => {
        try {
            await toggleFeatureEnvironmentOn(projectId, featureId, env.name);
            setToastData({
                type: 'success',
                show: true,<commit_msg>fix: remove console.log<commit_after>import { Cloud } from '@material-ui/icons';
import { IFeatureEnvironment } from '../../../../../../interfaces/featureToggle';
import { Switch } from '@material-ui/core';
import { useStyles } from './FeatureOverviewEnvironment.styles';
import FeatureOverviewStrategyCard from './FeatureOverviewStrategyCard/FeatureOverviewStrategyCard';
import classNames from 'classnames';
import ConditionallyRender from '../../../../../common/ConditionallyRender';
import useFeatureApi from '../../../../../../hooks/api/actions/useFeatureApi/useFeatureApi';
import { useHistory, useParams, Link } from 'react-router-dom';
import { IFeatureViewParams } from '../../../../../../interfaces/params';
import useToast from '../../../../../../hooks/useToast';

interface IFeatureOverviewEnvironmentProps {
    env: IFeatureEnvironment;
    refetch: () => void;
}

const FeatureOverviewEnvironment = ({
    env,
    refetch,
}: IFeatureOverviewEnvironmentProps) => {
    const { featureId, projectId } = useParams<IFeatureViewParams>();
    const { toggleFeatureEnvironmentOn, toggleFeatureEnvironmentOff } =
        useFeatureApi();
    const styles = useStyles();
    const { toast, setToastData } = useToast();
    const history = useHistory();

    const handleClick = () => {
        history.push(
            `/projects/${projectId}/features2/${featureId}/strategies?environment=${env.name}`
        );
    };

    const renderStrategies = () => {
        const { strategies } = env;

        return strategies.map(strategy => {
            return (
                <FeatureOverviewStrategyCard
                    strategy={strategy}
                    key={strategy.id}
                    onClick={handleClick}
                />
            );
        });
    };

    const handleToggleEnvironmentOn = async () => {
        try {
            await toggleFeatureEnvironmentOn(projectId, featureId, env.name);
            setToastData({
                type: 'success',
                show: true,
{'fraction_non_alphanumeric': 0.14902541327411795, 'fraction_numerical': 0.0004934616333580064, 'mean_word_length': 2.46199829205807, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6208988', 'n_tokens_mistral': 1023, 'n_tokens_neox': 1013, 'n_words': 210}