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 place_categoriesSlice from "./place_categories/place_categoriesSlice";
import placesSlice from "./places/placesSlice";
import place_opening_hoursSlice from "./place_opening_hours/place_opening_hoursSlice";
import place_featuresSlice from "./place_features/place_featuresSlice";
import place_feature_linksSlice from "./place_feature_links/place_feature_linksSlice";
import reviewsSlice from "./reviews/reviewsSlice";
import favoritesSlice from "./favorites/favoritesSlice";
import search_logsSlice from "./search_logs/search_logsSlice";
import reportsSlice from "./reports/reportsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
place_categories: place_categoriesSlice,
places: placesSlice,
place_opening_hours: place_opening_hoursSlice,
place_features: place_featuresSlice,
place_feature_links: place_feature_linksSlice,
reviews: reviewsSlice,
favorites: favoritesSlice,
search_logs: search_logsSlice,
reports: reportsSlice,
  },
})

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