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_relationshipsSlice from "./user_relationships/user_relationshipsSlice";
import postsSlice from "./posts/postsSlice";
import post_commentsSlice from "./post_comments/post_commentsSlice";
import post_reactionsSlice from "./post_reactions/post_reactionsSlice";
import post_savesSlice from "./post_saves/post_savesSlice";
import save_collectionsSlice from "./save_collections/save_collectionsSlice";
import hashtagsSlice from "./hashtags/hashtagsSlice";
import post_hashtagsSlice from "./post_hashtags/post_hashtagsSlice";
import storiesSlice from "./stories/storiesSlice";
import story_viewsSlice from "./story_views/story_viewsSlice";
import highlightsSlice from "./highlights/highlightsSlice";
import highlight_itemsSlice from "./highlight_items/highlight_itemsSlice";
import reelsSlice from "./reels/reelsSlice";
import reel_reactionsSlice from "./reel_reactions/reel_reactionsSlice";
import reel_commentsSlice from "./reel_comments/reel_commentsSlice";
import conversationsSlice from "./conversations/conversationsSlice";
import conversation_membersSlice from "./conversation_members/conversation_membersSlice";
import messagesSlice from "./messages/messagesSlice";
import callsSlice from "./calls/callsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import reportsSlice from "./reports/reportsSlice";
import productsSlice from "./products/productsSlice";
import insight_snapshotsSlice from "./insight_snapshots/insight_snapshotsSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
user_relationships: user_relationshipsSlice,
posts: postsSlice,
post_comments: post_commentsSlice,
post_reactions: post_reactionsSlice,
post_saves: post_savesSlice,
save_collections: save_collectionsSlice,
hashtags: hashtagsSlice,
post_hashtags: post_hashtagsSlice,
stories: storiesSlice,
story_views: story_viewsSlice,
highlights: highlightsSlice,
highlight_items: highlight_itemsSlice,
reels: reelsSlice,
reel_reactions: reel_reactionsSlice,
reel_comments: reel_commentsSlice,
conversations: conversationsSlice,
conversation_members: conversation_membersSlice,
messages: messagesSlice,
calls: callsSlice,
notifications: notificationsSlice,
reports: reportsSlice,
products: productsSlice,
insight_snapshots: insight_snapshotsSlice,
  },
})

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