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

interface UIState {
    isLoading: boolean;
}

const initialState: UIState = {
    isLoading: false
}

const uiSlice = createSlice({
        name: 'ui',
        initialState,
        reducers: {
            setIsLoading: (state, action: PayloadAction<boolean>) => {
                state.isLoading = action.payload;
            }
        }
    }
)

export default uiSlice.reducer;
export const {setIsLoading} = uiSlice.actions;