BOD-25 BOD-24 Uploading to cloudinary + thumbnail generation
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Button, notification } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import axios from "axios";
|
||||
|
||||
export default function JobsDocumentsDownloadButton({ galleryImages }) {
|
||||
const { t } = useTranslation();
|
||||
const imagesToDownload = galleryImages.filter((image) => image.isSelected);
|
||||
const handleDelete = () => {
|
||||
axios
|
||||
.post("/media/download", {
|
||||
ids: imagesToDownload.map((_) => _.key),
|
||||
})
|
||||
.then((r) => {
|
||||
window.open(r.data);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Button disabled={imagesToDownload.length < 1} onClick={handleDelete}>
|
||||
{t("documents.actions.download")}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user