import Taro, { useReady } from '@tarojs/taro';


interface UploadOptions {
    errMsg?: string;
    [key: string]: any;
}

export const useUploadVideo = (
    onUpload: (options: UploadOptions) => void
) => {
    useReady(() => {
        const pages = Taro.getCurrentPages();
        const currentPage = pages[pages.length - 1];

        if (currentPage) {
            currentPage.onUploadDouyinVideo = onUpload;
        }
    });
};