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 pagesSlice from "./pages/pagesSlice";
import cta_buttonsSlice from "./cta_buttons/cta_buttonsSlice";
import feature_highlightsSlice from "./feature_highlights/feature_highlightsSlice";
import galleriesSlice from "./galleries/galleriesSlice";
import gallery_itemsSlice from "./gallery_items/gallery_itemsSlice";
import coffee_regionsSlice from "./coffee_regions/coffee_regionsSlice";
import coffee_lotsSlice from "./coffee_lots/coffee_lotsSlice";
import quality_processesSlice from "./quality_processes/quality_processesSlice";
import process_stepsSlice from "./process_steps/process_stepsSlice";
import quality_metricsSlice from "./quality_metrics/quality_metricsSlice";
import export_service_itemsSlice from "./export_service_items/export_service_itemsSlice";
import sustainability_initiativesSlice from "./sustainability_initiatives/sustainability_initiativesSlice";
import testimonialsSlice from "./testimonials/testimonialsSlice";
import newsletter_subscribersSlice from "./newsletter_subscribers/newsletter_subscribersSlice";
import inquiriesSlice from "./inquiries/inquiriesSlice";
import contact_locationsSlice from "./contact_locations/contact_locationsSlice";
import site_settingsSlice from "./site_settings/site_settingsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
pages: pagesSlice,
cta_buttons: cta_buttonsSlice,
feature_highlights: feature_highlightsSlice,
galleries: galleriesSlice,
gallery_items: gallery_itemsSlice,
coffee_regions: coffee_regionsSlice,
coffee_lots: coffee_lotsSlice,
quality_processes: quality_processesSlice,
process_steps: process_stepsSlice,
quality_metrics: quality_metricsSlice,
export_service_items: export_service_itemsSlice,
sustainability_initiatives: sustainability_initiativesSlice,
testimonials: testimonialsSlice,
newsletter_subscribers: newsletter_subscribersSlice,
inquiries: inquiriesSlice,
contact_locations: contact_locationsSlice,
site_settings: site_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
