Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Fix `<AttachmentField>` in edition mode

React-Admin CI9fcb9df9b87e
diff --git a/src/components/atomic-crm/notes/AttachmentField.tsx b/src/components/atomic-crm/notes/AttachmentField.tsx
index d80dfd11..b6abeccf 100644
--- a/src/components/atomic-crm/notes/AttachmentField.tsx
+++ b/src/components/atomic-crm/notes/AttachmentField.tsx
@@ -77,9 +77,11 @@ export const AttachmentField = (props: FileFieldProps) => {
);
}
+ const type = record?.rawFile?.type ?? record?.type;
+
return (
<div className={cn("inline-block", className)} {...rest}>
- {isImageMimeType(record?.rawFile.type) ? (
+ {isImageMimeType(type) ? (
<img
alt={titleValue}
title={titleValue}