import { IFilesFolder, IFolderTree } from "@ax/types";
import {
	SET_BREADCRUMB,
	SET_CURRENT_FOLDER,
	SET_CURRENT_FOLDER_CONTENT,
	SET_DISPLAY_MODE,
	SET_FOLDERS_TREE,
	SET_IS_UPLOADING,
	SET_SELECTED_TAB,
	SET_UPLOAD_ERROR,
	SET_UPLOAD_SUCCESS,
} from "./constants";

export interface ISetCurrentFolderContent {
	type: typeof SET_CURRENT_FOLDER_CONTENT;
	payload: { currentFolderContent: IFilesFolder | null };
}

export interface ISetCurrentFolder {
	type: typeof SET_CURRENT_FOLDER;
	payload: { currentFolderID: number | null };
}

export interface ISetBreadcrumb {
	type: typeof SET_BREADCRUMB;
	payload: { breadcrumb: IFolderTree[] };
}

export interface ISetFoldersTree {
	type: typeof SET_FOLDERS_TREE;
	payload: { foldersTree: IFolderTree[] };
}

export interface ISetIsUploading {
	type: typeof SET_IS_UPLOADING;
	payload: { isUploading: boolean };
}

export interface ISetUploadSuccess {
	type: typeof SET_UPLOAD_SUCCESS;
	payload: { isUploading: boolean; isSuccess: boolean };
}

export interface ISetUploadError {
	type: typeof SET_UPLOAD_ERROR;
	payload: { isUploading: boolean; isError: boolean; errorMsg: string };
}

export interface ISetDisplayMode {
	type: typeof SET_DISPLAY_MODE;
	payload: { displayMode: "grid" | "list" };
}

export interface ISetSelectedTab {
	type: typeof SET_SELECTED_TAB;
	payload: { selectedTab: "site" | "global" };
}

export type FileDriveActionsCreators = ISetCurrentFolderContent;
