import { combineReducers } from 'redux';
import userReducer from 'models/user';
import tenantReducer from 'models/tenant';
import templateReducer from 'models/template';
import constantReducer from 'models/constant';
import mobileConstantReducer from 'models/mobile-constant';
import fontReducer from 'models/font';
import screensReducer from 'models/screens';
import groupReducer from 'models/group';
import interactionEditReducer from 'containers/interaction-edit/models';
import interactionListReducer from 'containers/interaction-list/models';
import interactionDetailReducer from 'containers/interaction-detail/models';
import themeReducer from 'models/theme';
import favoriteReducer from 'models/favorite';
import moduleReducer from 'models/module';
import panelReducer from 'models/panel';
import screenReducer from 'models/screen';
import componentReducer from 'models/component';
import filterReducer from 'models/filter';
import callbackReducer from 'models/callback';
import interactionReducer from 'models/interaction';
import sourceReducer from 'models/source';
import createAppReducer from 'models/create-app';
import screenDetailReducer from 'models/screen-detail';
import panelDetailReducer from 'models/panel-detail';
import appReducer from 'models/app';
import backupReducer from 'models/backup';
import tenantConstantReducer from 'models/tenant-constant';
import RecycleReducer from 'models/commentDelted';
import UpdateVersion from 'models/updateVersion';
import AnnState from 'models/announcement';
import Space from 'models/space';
import MaterialLib from 'models/material-lib';
import transferReducer from 'models/transfer';
import editState from 'models/screen-edit';
import spaceShipReducer from 'models/spaceship';
import dataContainers from 'models/data-container';
import course from 'models/course';
import node from 'models/node';
import queue from 'models/queue';
import screensStatus from 'models/screensStatus';

const rootReducer = combineReducers({
  createApp: createAppReducer,
  screenDetail: screenDetailReducer,
  screenEdit: editState,
  user: userReducer,
  tenant: tenantReducer,
  screens: screensReducer,
  dataContainers: dataContainers, // 数据容器
  templates: templateReducer,
  constants: constantReducer,
  tenantConstants: tenantConstantReducer,
  mobileConstants: mobileConstantReducer,
  fonts: fontReducer,
  node: node,
  queue: queue, // 队列
  groups: groupReducer,
  interactionEdit: interactionEditReducer,
  interactionList: interactionListReducer,
  interactionDetail: interactionDetailReducer,
  themes: themeReducer,
  favorite: favoriteReducer,
  modules: moduleReducer,
  panelsById: panelReducer,
  screensById: screenReducer,
  componentsById: componentReducer,
  filters: filterReducer,
  course: course,
  callback: callbackReducer,
  interactions: interactionReducer,
  sources: sourceReducer,
  panelDetail: panelDetailReducer,
  apps: appReducer,
  backup: backupReducer,
  recycleBinData: RecycleReducer, // 回收站
  updateVersion: UpdateVersion, //版本升级提示
  annData: AnnState, // 公告列表
  space: Space, //空间管理
  materialLib: MaterialLib, // create -> 素材中心
  transfer: transferReducer, // 平台迁移
  spaceShip: spaceShipReducer,
  screensStatus,
});

export default rootReducer;

export type RootState = ReturnType<typeof rootReducer>;
