import { createActionGroup, emptyProps, props } from '@ngrx/store';
import { ToastStore } from '../../interfaces/store/toast.interface';

export const toastActions = createActionGroup({
  source: 'Toast',
  events: {
    SET_TOASTS: props<{ toasts: ToastStore }>(),
    RESET_TOASTS: emptyProps(),

    SHOW_TOAST_SUCCESS: props<{ toast: ToastStore['success'] }>(),
    HIDE_TOAST_SUCCESS: emptyProps(),

    SHOW_TOAST_WARN: props<{ toast: ToastStore['warn'] }>(),
    HIDE_TOAST_WARN: emptyProps(),

    SHOW_TOAST_ERROR: props<{ toast: ToastStore['error'] }>(),
    HIDE_TOAST_ERROR: emptyProps(),
  },
});
