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 contact_locationsSlice from "./contact_locations/contact_locationsSlice";
import social_linksSlice from "./social_links/social_linksSlice";
import hero_slidesSlice from "./hero_slides/hero_slidesSlice";
import stone_categoriesSlice from "./stone_categories/stone_categoriesSlice";
import stone_colorsSlice from "./stone_colors/stone_colorsSlice";
import finishesSlice from "./finishes/finishesSlice";
import applicationsSlice from "./applications/applicationsSlice";
import stonesSlice from "./stones/stonesSlice";
import stone_variantsSlice from "./stone_variants/stone_variantsSlice";
import stone_3d_assetsSlice from "./stone_3d_assets/stone_3d_assetsSlice";
import servicesSlice from "./services/servicesSlice";
import technologiesSlice from "./technologies/technologiesSlice";
import service_technologiesSlice from "./service_technologies/service_technologiesSlice";
import projectsSlice from "./projects/projectsSlice";
import project_mediaSlice from "./project_media/project_mediaSlice";
import team_membersSlice from "./team_members/team_membersSlice";
import blog_categoriesSlice from "./blog_categories/blog_categoriesSlice";
import blog_postsSlice from "./blog_posts/blog_postsSlice";
import lead_requestsSlice from "./lead_requests/lead_requestsSlice";
import quote_itemsSlice from "./quote_items/quote_itemsSlice";
import inquiriesSlice from "./inquiries/inquiriesSlice";
import seo_pagesSlice from "./seo_pages/seo_pagesSlice";
import media_librarySlice from "./media_library/media_librarySlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
site_settings: site_settingsSlice,
contact_locations: contact_locationsSlice,
social_links: social_linksSlice,
hero_slides: hero_slidesSlice,
stone_categories: stone_categoriesSlice,
stone_colors: stone_colorsSlice,
finishes: finishesSlice,
applications: applicationsSlice,
stones: stonesSlice,
stone_variants: stone_variantsSlice,
stone_3d_assets: stone_3d_assetsSlice,
services: servicesSlice,
technologies: technologiesSlice,
service_technologies: service_technologiesSlice,
projects: projectsSlice,
project_media: project_mediaSlice,
team_members: team_membersSlice,
blog_categories: blog_categoriesSlice,
blog_posts: blog_postsSlice,
lead_requests: lead_requestsSlice,
quote_items: quote_itemsSlice,
inquiries: inquiriesSlice,
seo_pages: seo_pagesSlice,
media_library: media_librarySlice,
  },
})

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