import { createSlice } from '@reduxjs/toolkit'; interface HistoryPanelSwitchState { currentPanel: 'OperationPanel' | 'SendPanel'; } const initialState: HistoryPanelSwitchState = { currentPanel: 'OperationPanel', }; const historyPanelSwitchSlice = createSlice({ name: 'historyPanelSwitch', initialState, reducers: { switchToOperationPanel: (state) => { state.currentPanel = 'OperationPanel'; }, switchToSendPanel: (state) => { state.currentPanel = 'SendPanel'; }, }, }); export const { switchToOperationPanel, switchToSendPanel } = historyPanelSwitchSlice.actions; export default historyPanelSwitchSlice.reducer;