import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';
import openAiSlice from './openAiSlice';

import usersSlice from "./users/usersSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";
import ai_modelsSlice from "./ai_models/ai_modelsSlice";
import api_keysSlice from "./api_keys/api_keysSlice";
import extensionsSlice from "./extensions/extensionsSlice";
import surveysSlice from "./surveys/surveysSlice";
import fill_sessionsSlice from "./fill_sessions/fill_sessionsSlice";
import request_queueSlice from "./request_queue/request_queueSlice";
import connection_logsSlice from "./connection_logs/connection_logsSlice";
import profilesSlice from "./profiles/profilesSlice";
import settingsSlice from "./settings/settingsSlice";

export const store = configureStore({
  reducer: {
    style: styleReducer,
    main: mainReducer,
    auth: authSlice,
    openAi: openAiSlice,

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
ai_models: ai_modelsSlice,
api_keys: api_keysSlice,
extensions: extensionsSlice,
surveys: surveysSlice,
fill_sessions: fill_sessionsSlice,
request_queue: request_queueSlice,
connection_logs: connection_logsSlice,
profiles: profilesSlice,
settings: settingsSlice,
  },
})

// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
