export function useDownloadDocument(client, toast, uri, name) {
    const onDownload = () => {
        if (uri) {
            client.files
                .getDownloadUrlWithOptions({ file: uri, name })
                .then((r) => {
                window.open(r.url, "_blank");
            })
                .catch((err) => {
                toast({
                    status: "error",
                    title: "Failed to get download URL",
                    description: err.message,
                    duration: 5000,
                });
            });
        }
    };
    return onDownload;
}
//# sourceMappingURL=useDownloadObject.js.map