File size: 476 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { type NoticeMessage } from '../../interfaces/noticeMessage.interface.js'
import { type NoticeMessageInState } from '../reducers/noticesReducer.js'

export const ADD_NOTICE = 'ADD_NOTICE'

export type AddNoticeResponse = {
  type: typeof ADD_NOTICE
  data: NoticeMessageInState
}

export const addNotice = (data: NoticeMessage): AddNoticeResponse => ({
  type: ADD_NOTICE,
  data: {
    id: `notice-${Date.now() + Math.random()}`,
    progress: 0,
    ...data,
  },
})