import { v4 as uuidv4 } from 'uuid';
import { t } from 'i18next';
import { getUniqueName } from '../../../../../../../../../utils/get-unique-name';
import { addValue } from '../../../../../../../../commands';
import { STATE_TYPE } from '../../const';
export const addState = (destinationPath) => (dispatch, getState) => {
    const destination = getState(destinationPath);
    dispatch(addValue(destinationPath, {
        id: uuidv4(),
        name: getUniqueName(t('components.animatable.editor.state.new.title'), destination),
        type: STATE_TYPE.INDIVIDUAL,
        speed: 1,
        timeline: {
            frames: [],
            looped: false,
        },
        transitions: [],
    }));
};
