+ {attachments.map((attachment, idx) => {
+ const extension = attachment.split('.').pop()?.toLowerCase();
+ const isImage = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'].includes(extension || '');
+ const isPdf = extension === 'pdf';
+ const isMd = extension === 'md';
+ const isCode = ['js', 'jsx', 'ts', 'tsx', 'py', 'html', 'css', 'json'].includes(extension || '');
+
+ let icon =
;
+ if (isImage) icon =
;
+ if (isPdf) icon =
;
+ if (isMd) icon =
;
+ if (isCode) icon =
;
+
+ return (
+
+ );
+ })}
+