import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit";
import login from "features/login/loginSlice";
import auth from "features/auth/authSlice";
import signup from "features/signup/signupSlice";
import verify from "features/verify/verifySlice";
import ui from "features/ui/uiSlice";
import user from "features/user/userSlice";
import license from "features/license/licenseOrder/licenseSlice";
import licenseCardIssue from "features/license/licenseCardIssue/licenseCardIssueSlice";
import licenseCardActivate from "features/license/licenseCardActivate/licenseCardActivateSlice";
import licenseSummary from "features/license/licenseSummary/licenseSummarySlice";
import partnerLicense from "features/license/partnerLicense/partnerLicenseSlice";
import dictation from "features/dictation/dictationSlice";
import partner from "features/partner/partnerSlice";
import licenseOrderHistory from "features/license/licenseOrderHistory/licenseOrderHistorySlice";

export const store = configureStore({
  reducer: {
    login,
    auth,
    signup,
    verify,
    ui,
    user,
    license,
    licenseCardIssue,
    licenseCardActivate,
    licenseSummary,
    licenseOrderHistory,
    partnerLicense,
    dictation,
    partner,
  },
});

export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
  ReturnType,
  RootState,
  unknown,
  Action<string>
>;

export type AppDispatch = typeof store.dispatch;
