import api from "@shared/api"

interface IUseSubmitCaptionGenerateParams {
	onSuccess?: (data: { job_id: string }) => void
	onError?: (error: unknown) => void
}

export const useSubmitCaptionGenerate = ({
	onSuccess,
	onError,
}: IUseSubmitCaptionGenerateParams = {}) => {
	return api.useMutation("post", "/api/tasks/captions-generate/", {
		onSuccess: (data) => {
			onSuccess?.(data)
		},
		onError: (error) => {
			onError?.(error)
		},
	})
}
