Files
encoach_frontend/src/stores/examEditor/index.ts
2025-02-06 12:12:34 +00:00

26 lines
728 B
TypeScript

import defaultModuleSettings from "./defaults";
import {Action, rootReducer} from "./reducers";
import ExamEditorStore from "./types";
import {create} from "zustand";
const useExamEditorStore = create<
ExamEditorStore & {
dispatch: (action: Action) => void;
}
>((set) => ({
title: "",
globalEdit: [],
currentModule: "reading",
speakingAvatars: [],
modules: {
reading: defaultModuleSettings("reading", 60),
writing: defaultModuleSettings("writing", 60),
speaking: defaultModuleSettings("speaking", 14),
listening: defaultModuleSettings("listening", 30),
level: defaultModuleSettings("level", 60),
},
dispatch: (action) => set((state) => rootReducer(state, action)),
}));
export default useExamEditorStore;