File size: 629 Bytes
246d201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { StatusMessage } from "#/types/message";

const initialStatusMessage: StatusMessage = {
  status_update: true,
  type: "info",
  id: "",
  message: "",
};

export const statusSlice = createSlice({
  name: "status",
  initialState: {
    curStatusMessage: initialStatusMessage,
  },
  reducers: {
    setCurStatusMessage: (state, action: PayloadAction<StatusMessage>) => {
      state.curStatusMessage = action.payload;
    },
  },
});

export const { setCurStatusMessage } = statusSlice.actions;

export default statusSlice.reducer;