added document files properly handling inside
This commit is contained in:
parent
4238157fd4
commit
9cd9e0fbbe
@ -172,15 +172,15 @@ const ViewCollection = ({ onClose }) => {
|
|||||||
|
|
||||||
<div className="d-flex flex-wrap gap-2">
|
<div className="d-flex flex-wrap gap-2">
|
||||||
{data?.attachments?.map((doc) => {
|
{data?.attachments?.map((doc) => {
|
||||||
const isImage = doc.contentType?.includes("image");
|
const isImage = doc.contentType?.startsWith("image");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={doc.documentId}
|
key={doc.documentId}
|
||||||
className="border rounded hover-scale p-2 d-flex flex-column align-items-center"
|
className="border rounded hover-scale p-2 d-flex flex-column align-items-center"
|
||||||
style={{
|
style={{
|
||||||
width: "80px",
|
width: "80px",
|
||||||
cursor: isImage ? "pointer" : "default",
|
cursor: "pointer",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (isImage) {
|
if (isImage) {
|
||||||
@ -188,6 +188,8 @@ const ViewCollection = ({ onClose }) => {
|
|||||||
IsOpen: true,
|
IsOpen: true,
|
||||||
Image: doc.preSignedUrl,
|
Image: doc.preSignedUrl,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
window.open(doc.preSignedUrl, "_blank");
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user