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 postsSlice from "./posts/postsSlice";
import commentsSlice from "./comments/commentsSlice";
import reactionsSlice from "./reactions/reactionsSlice";
import storiesSlice from "./stories/storiesSlice";
import conversationsSlice from "./conversations/conversationsSlice";
import messagesSlice from "./messages/messagesSlice";
import groupsSlice from "./groups/groupsSlice";
import eventsSlice from "./events/eventsSlice";
import ticketsSlice from "./tickets/ticketsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import user_settingsSlice from "./user_settings/user_settingsSlice";
import followsSlice from "./follows/followsSlice";
import hashtagsSlice from "./hashtags/hashtagsSlice";
import post_hashtagsSlice from "./post_hashtags/post_hashtagsSlice";
import media_assetsSlice from "./media_assets/media_assetsSlice";
import live_streamsSlice from "./live_streams/live_streamsSlice";
import transactionsSlice from "./transactions/transactionsSlice";
import ai_recommendationsSlice from "./ai_recommendations/ai_recommendationsSlice";
import content_moderation_reportsSlice from "./content_moderation_reports/content_moderation_reportsSlice";
import gamification_badgesSlice from "./gamification_badges/gamification_badgesSlice";
import user_badgesSlice from "./user_badges/user_badgesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
posts: postsSlice,
comments: commentsSlice,
reactions: reactionsSlice,
stories: storiesSlice,
conversations: conversationsSlice,
messages: messagesSlice,
groups: groupsSlice,
events: eventsSlice,
tickets: ticketsSlice,
notifications: notificationsSlice,
user_settings: user_settingsSlice,
follows: followsSlice,
hashtags: hashtagsSlice,
post_hashtags: post_hashtagsSlice,
media_assets: media_assetsSlice,
live_streams: live_streamsSlice,
transactions: transactionsSlice,
ai_recommendations: ai_recommendationsSlice,
content_moderation_reports: content_moderation_reportsSlice,
gamification_badges: gamification_badgesSlice,
user_badges: user_badgesSlice,
  },
})

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