import { useMutation } from "@tanstack/react-query";
import * as api from "../service/UploaderService";

export type SingleUploadParams = {
  file: File;
  onProgress?: (progress: number) => void;
};

export const useSingleUpload = () => {
  return useMutation({
    mutationFn: ({ file, onProgress }: SingleUploadParams) =>
      api.singleUpload(file, onProgress),
  });
};

export const useMultipleUpload = () => {
  return useMutation({
    mutationFn: api.multipleUpload,
  });
};
