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