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 organizationsSlice from "./organizations/organizationsSlice";
import coursesSlice from "./courses/coursesSlice";
import lessonsSlice from "./lessons/lessonsSlice";
import exercisesSlice from "./exercises/exercisesSlice";
import gamesSlice from "./games/gamesSlice";
import interactive_activitiesSlice from "./interactive_activities/interactive_activitiesSlice";
import content_itemsSlice from "./content_items/content_itemsSlice";
import learning_pathsSlice from "./learning_paths/learning_pathsSlice";
import enrollmentsSlice from "./enrollments/enrollmentsSlice";
import progress_recordsSlice from "./progress_records/progress_recordsSlice";
import attemptsSlice from "./attempts/attemptsSlice";
import leaderboardsSlice from "./leaderboards/leaderboardsSlice";
import leaderboard_entriesSlice from "./leaderboard_entries/leaderboard_entriesSlice";
import ai_mentor_profilesSlice from "./ai_mentor_profiles/ai_mentor_profilesSlice";
import mentor_conversationsSlice from "./mentor_conversations/mentor_conversationsSlice";
import mentor_messagesSlice from "./mentor_messages/mentor_messagesSlice";
import problem_reportsSlice from "./problem_reports/problem_reportsSlice";
import solution_proposalsSlice from "./solution_proposals/solution_proposalsSlice";
import votesSlice from "./votes/votesSlice";
import commentsSlice from "./comments/commentsSlice";
import notificationsSlice from "./notifications/notificationsSlice";
import badgesSlice from "./badges/badgesSlice";
import user_badgesSlice from "./user_badges/user_badgesSlice";
import eventsSlice from "./events/eventsSlice";
import event_registrationsSlice from "./event_registrations/event_registrationsSlice";
import site_pagesSlice from "./site_pages/site_pagesSlice";

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

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
courses: coursesSlice,
lessons: lessonsSlice,
exercises: exercisesSlice,
games: gamesSlice,
interactive_activities: interactive_activitiesSlice,
content_items: content_itemsSlice,
learning_paths: learning_pathsSlice,
enrollments: enrollmentsSlice,
progress_records: progress_recordsSlice,
attempts: attemptsSlice,
leaderboards: leaderboardsSlice,
leaderboard_entries: leaderboard_entriesSlice,
ai_mentor_profiles: ai_mentor_profilesSlice,
mentor_conversations: mentor_conversationsSlice,
mentor_messages: mentor_messagesSlice,
problem_reports: problem_reportsSlice,
solution_proposals: solution_proposalsSlice,
votes: votesSlice,
comments: commentsSlice,
notifications: notificationsSlice,
badges: badgesSlice,
user_badges: user_badgesSlice,
events: eventsSlice,
event_registrations: event_registrationsSlice,
site_pages: site_pagesSlice,
  },
})

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