import { IMenu, IMenuForm, IMenuItem } from "@ax/types";

import { SET_TOTAL_ITEMS } from "@ax/containers/Sites/constants";
import {
	SET_ORIGINAL_MENUS,
	SET_ORIGINAL_MENU,
	SET_EDITOR_MENU,
	SET_ITEM,
	SET_MENU_FORM_DATA,
	SET_CURRENT_TYPE,
} from "./constants";

export interface ISetSavedMenus {
	type: typeof SET_ORIGINAL_MENUS;
	payload: { savedMenus: IMenu[] };
}

export interface ISetSavedMenu {
	type: typeof SET_ORIGINAL_MENU;
	payload: { savedMenu: IMenu };
}

export interface ISetEditorMenu {
	type: typeof SET_EDITOR_MENU;
	payload: { editorMenu: IMenu | null };
}

export interface ISetItem {
	type: typeof SET_ITEM;
	payload: { item: IMenuItem | null };
}

export interface ISetMenuForm {
	type: typeof SET_MENU_FORM_DATA;
	payload: { form: IMenuForm };
}

export interface ISetTotalItems {
	type: typeof SET_TOTAL_ITEMS;
	payload: { totalItems: number };
}

export interface ISetCurrentType {
	type: typeof SET_CURRENT_TYPE;
	payload: { currentType: string };
}

export type MenuActionsCreators = ISetSavedMenus | ISetEditorMenu | ISetItem | ISetTotalItems;
