visuddhinanda 3 년 전
부모
커밋
0993489244
1개의 변경된 파일32개의 추가작업 그리고 0개의 파일을 삭제
  1. 32 0
      dashboard/src/reducers/right-panel.ts

+ 32 - 0
dashboard/src/reducers/right-panel.ts

@@ -0,0 +1,32 @@
+/**
+ * 查字典,添加术语命令
+ */
+import { createSlice, PayloadAction } from "@reduxjs/toolkit";
+
+import type { RootState } from "../store";
+
+export interface ITermCommand {}
+
+interface IState {
+  open?: "dict" | "channel" | "close";
+}
+
+const initialState: IState = {};
+
+export const slice = createSlice({
+  name: "right-pannel",
+  initialState,
+  reducers: {
+    //TODO 去掉command
+    openPanel: (state, action: PayloadAction<"dict" | "channel" | "close">) => {
+      state.open = action.payload;
+    },
+  },
+});
+
+export const { openPanel } = slice.actions;
+
+export const rightPanel = (state: RootState): string | undefined =>
+  state.rightPanel.open;
+
+export default slice.reducer;