import { MessageBarType } from '@fluentui/react'; import { INotification } from '../models/INotification'; import { IAppContextState } from './IAppContextState'; export type Action = { type: 'SET_NOTIFICATION'; payload: INotification }; export const initialState: IAppContextState = { notification: { messageBarType: MessageBarType.info, message: 'Blah blah blah', isMultiline: false, isVisible: true } }; export const reducer = ( state: IAppContextState, action: Action ): IAppContextState => { switch (action.type) { case 'SET_NOTIFICATION': { return { ...state, notification: action.payload }; } } };