import { createSlice } from "@reduxjs/toolkit"
import {
  addExpandedWidgetReducer,
  changeSelectedAction,
  clearSelectedComponent,
  minusScale,
  plusScale,
  removeExpandWidgetReducer,
  removeExpandedKey,
  resetConfig,
  // resetSelectedActionReducer,
  setDraggingNodeIDsReducer,
  setExpandedKey,
  setResizingNodeIDsReducer,
  updateBottomPanel,
  updateCachedAction,
  // updateCachedActionAdvancedConfigReducer,
  // updateCachedActionMockConfigReducer,
  updateCanvasShapeReducer,
  updateDebuggerVisible,
  updateDevicesOnlineStatusReducer,
  updateHoveredComponent,
  updateIllaMode,
  updateLeftPanel,
  updateRightPanel,
  updateSelectedComponent,
  updateShowDot,
  updateGridContainer
  // updateWSStatusReducer,
} from "@/redux/config/configReducer"
import { ConfigInitialState } from "@/redux/config/configState"

const configSlice = createSlice({
  name: "config",
  initialState: ConfigInitialState,
  reducers: {
    resetConfig,
    updateIllaMode,
    updateLeftPanel,
    updateRightPanel,
    updateBottomPanel,
    updateDebuggerVisible,
    updateShowDot,
    updateSelectedComponent,
    clearSelectedComponent,
    changeSelectedAction,
    updateCachedAction,
    // updateCachedActionAdvancedConfigReducer,
    // updateCachedActionMockConfigReducer,
    plusScale,
    minusScale,
    setExpandedKey,
    removeExpandedKey,
    updateCanvasShapeReducer,
    updateDevicesOnlineStatusReducer,
    // updateWSStatusReducer,
    updateHoveredComponent,
    // resetSelectedActionReducer,
    addExpandedWidgetReducer,
    removeExpandWidgetReducer,
    setDraggingNodeIDsReducer,
    setResizingNodeIDsReducer,
    updateGridContainer
  },
})

export const configActions = configSlice.actions
export default configSlice.reducer
