added document files properly handling inside

This commit is contained in:
pramod.mahajan 2025-10-25 11:20:57 +05:30
parent 4238157fd4
commit 9cd9e0fbbe

View File

@ -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");
}
}}
>