import { PayloadAction, createSlice } from "@reduxjs/toolkit";

export enum ConsoleType {
    idle = 'idle',
    going = 'going',
    end = 'end'
}

interface ConsoleState {
    status: ConsoleType
}

const initialState: ConsoleState = {
    status: ConsoleType.idle,
};

const consoleSlice = createSlice({
    name: 'console',
    initialState,
    reducers: {
        changeConsoleStatus: (state, action: PayloadAction<{ status: ConsoleType }>) => {
            state.status = action.payload.status;
        },
    },
});

export const { changeConsoleStatus } = consoleSlice.actions;
export default consoleSlice.reducer;