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 site_settingsSlice from "./site_settings/site_settingsSlice";
import pagesSlice from "./pages/pagesSlice";
import service_categoriesSlice from "./service_categories/service_categoriesSlice";
import servicesSlice from "./services/servicesSlice";
import projectsSlice from "./projects/projectsSlice";
import testimonialsSlice from "./testimonials/testimonialsSlice";
import faqsSlice from "./faqs/faqsSlice";
import leadsSlice from "./leads/leadsSlice";
import media_assetsSlice from "./media_assets/media_assetsSlice";
import home_sectionsSlice from "./home_sections/home_sectionsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
site_settings: site_settingsSlice,
pages: pagesSlice,
service_categories: service_categoriesSlice,
services: servicesSlice,
projects: projectsSlice,
testimonials: testimonialsSlice,
faqs: faqsSlice,
leads: leadsSlice,
media_assets: media_assetsSlice,
home_sections: home_sectionsSlice,
  },
})

// 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
