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 avatarsSlice from "./avatars/avatarsSlice";
import avatar_customizationsSlice from "./avatar_customizations/avatar_customizationsSlice";
import cosmeticsSlice from "./cosmetics/cosmeticsSlice";
import boxesSlice from "./boxes/boxesSlice";
import box_itemsSlice from "./box_items/box_itemsSlice";
import purchasesSlice from "./purchases/purchasesSlice";
import inventory_itemsSlice from "./inventory_items/inventory_itemsSlice";
import titlesSlice from "./titles/titlesSlice";
import badgesSlice from "./badges/badgesSlice";
import achievementsSlice from "./achievements/achievementsSlice";
import user_achievementsSlice from "./user_achievements/user_achievementsSlice";
import quizzesSlice from "./quizzes/quizzesSlice";
import quiz_questionsSlice from "./quiz_questions/quiz_questionsSlice";
import question_answersSlice from "./question_answers/question_answersSlice";
import quiz_tagsSlice from "./quiz_tags/quiz_tagsSlice";
import quiz_tag_linksSlice from "./quiz_tag_links/quiz_tag_linksSlice";
import orbix_quiz_assistant_sessionsSlice from "./orbix_quiz_assistant_sessions/orbix_quiz_assistant_sessionsSlice";
import game_modesSlice from "./game_modes/game_modesSlice";
import matchesSlice from "./matches/matchesSlice";
import match_playersSlice from "./match_players/match_playersSlice";
import match_questionsSlice from "./match_questions/match_questionsSlice";
import player_answersSlice from "./player_answers/player_answersSlice";
import wheel_eventsSlice from "./wheel_events/wheel_eventsSlice";
import music_playlistsSlice from "./music_playlists/music_playlistsSlice";
import music_tracksSlice from "./music_tracks/music_tracksSlice";
import eventsSlice from "./events/eventsSlice";
import daily_rewardsSlice from "./daily_rewards/daily_rewardsSlice";
import moderation_reportsSlice from "./moderation_reports/moderation_reportsSlice";
import community_modesSlice from "./community_modes/community_modesSlice";
import community_mode_build_sessionsSlice from "./community_mode_build_sessions/community_mode_build_sessionsSlice";
import leaderboard_entriesSlice from "./leaderboard_entries/leaderboard_entriesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
avatars: avatarsSlice,
avatar_customizations: avatar_customizationsSlice,
cosmetics: cosmeticsSlice,
boxes: boxesSlice,
box_items: box_itemsSlice,
purchases: purchasesSlice,
inventory_items: inventory_itemsSlice,
titles: titlesSlice,
badges: badgesSlice,
achievements: achievementsSlice,
user_achievements: user_achievementsSlice,
quizzes: quizzesSlice,
quiz_questions: quiz_questionsSlice,
question_answers: question_answersSlice,
quiz_tags: quiz_tagsSlice,
quiz_tag_links: quiz_tag_linksSlice,
orbix_quiz_assistant_sessions: orbix_quiz_assistant_sessionsSlice,
game_modes: game_modesSlice,
matches: matchesSlice,
match_players: match_playersSlice,
match_questions: match_questionsSlice,
player_answers: player_answersSlice,
wheel_events: wheel_eventsSlice,
music_playlists: music_playlistsSlice,
music_tracks: music_tracksSlice,
events: eventsSlice,
daily_rewards: daily_rewardsSlice,
moderation_reports: moderation_reportsSlice,
community_modes: community_modesSlice,
community_mode_build_sessions: community_mode_build_sessionsSlice,
leaderboard_entries: leaderboard_entriesSlice,
  },
})

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