import { createSlice } from "@reduxjs/toolkit"; export const notificationSlice = createSlice({ name: "notification", initialState: { notice: { title: "", text: "", event: "", type: "", progress: 0 }, }, reducers: { setNotice: (state, action) => { state.notice = action.payload; }, clearNotice: (state) => { state.notice = { title: "", text: "", event: "", type: "", progress: 0 }; }, }, }); export const { setNotice, clearNotice } = notificationSlice.actions; export default notificationSlice.reducer;