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 user_photosSlice from "./user_photos/user_photosSlice";
import languagesSlice from "./languages/languagesSlice";
import user_languagesSlice from "./user_languages/user_languagesSlice";
import interestsSlice from "./interests/interestsSlice";
import user_interestsSlice from "./user_interests/user_interestsSlice";
import discovery_preferencesSlice from "./discovery_preferences/discovery_preferencesSlice";
import swipesSlice from "./swipes/swipesSlice";
import matchesSlice from "./matches/matchesSlice";
import messagesSlice from "./messages/messagesSlice";
import chat_eventsSlice from "./chat_events/chat_eventsSlice";
import blocksSlice from "./blocks/blocksSlice";
import reportsSlice from "./reports/reportsSlice";
import report_attachmentsSlice from "./report_attachments/report_attachmentsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import daily_sparksSlice from "./daily_sparks/daily_sparksSlice";
import daily_spark_recommendationsSlice from "./daily_spark_recommendations/daily_spark_recommendationsSlice";
import premium_plansSlice from "./premium_plans/premium_plansSlice";
import subscriptionsSlice from "./subscriptions/subscriptionsSlice";
import user_settingsSlice from "./user_settings/user_settingsSlice";
import content_moderation_itemsSlice from "./content_moderation_items/content_moderation_itemsSlice";
import admin_usersSlice from "./admin_users/admin_usersSlice";
import analytics_eventsSlice from "./analytics_events/analytics_eventsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
user_photos: user_photosSlice,
languages: languagesSlice,
user_languages: user_languagesSlice,
interests: interestsSlice,
user_interests: user_interestsSlice,
discovery_preferences: discovery_preferencesSlice,
swipes: swipesSlice,
matches: matchesSlice,
messages: messagesSlice,
chat_events: chat_eventsSlice,
blocks: blocksSlice,
reports: reportsSlice,
report_attachments: report_attachmentsSlice,
notifications: notificationsSlice,
daily_sparks: daily_sparksSlice,
daily_spark_recommendations: daily_spark_recommendationsSlice,
premium_plans: premium_plansSlice,
subscriptions: subscriptionsSlice,
user_settings: user_settingsSlice,
content_moderation_items: content_moderation_itemsSlice,
admin_users: admin_usersSlice,
analytics_events: analytics_eventsSlice,
  },
})

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