import {createSlice} from '@reduxjs/toolkit';
import type {PayloadAction} from '@reduxjs/toolkit';

import {appStatus, non_save_vars} from './appNonSaveVar';

import {ThemeColorsType} from '@configs/colors';

export const appNonSaveVariablesSlice = createSlice({
  name: 'non_save_vars',
  initialState: non_save_vars,
  reducers: {
    setAppStatus: (state, action: PayloadAction<appStatus>) => {
      state.appStatus = action.payload;
    },
    setThemeColors: (state, action: PayloadAction<ThemeColorsType>) => {
      state.themeColors = action.payload;
    },
  },
});

// Action creators are generated for each case reducer function
const {actions} = appNonSaveVariablesSlice;
export const appNonSaveVarActions = actions;

export default appNonSaveVariablesSlice.reducer;
