diff --git a/client/src/components/Collab/CollabNotes.tsx b/client/src/components/Collab/CollabNotes.tsx index 933ca84..0e449e3 100644 --- a/client/src/components/Collab/CollabNotes.tsx +++ b/client/src/components/Collab/CollabNotes.tsx @@ -1350,6 +1350,41 @@ export default function CollabNotes({ tripId, currentUser }: CollabNotesProps) {
{viewingNote.content || ''} + {(viewingNote.attachments || []).length > 0 && ( +
+
{t('files.title')}
+
+ {(viewingNote.attachments || []).map(a => { + const isImage = a.mime_type?.startsWith('image/') + const ext = (a.original_name || '').split('.').pop()?.toUpperCase() || '?' + return ( +
+ {isImage ? ( + setPreviewFile(a)} + onMouseEnter={e => { e.currentTarget.style.transform = 'scale(1.06)'; e.currentTarget.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)' }} + onMouseLeave={e => { e.currentTarget.style.transform = 'scale(1)'; e.currentTarget.style.boxShadow = 'none' }} /> + ) : ( +
setPreviewFile(a)} + style={{ + width: 64, height: 64, borderRadius: 8, cursor: 'pointer', + background: a.mime_type === 'application/pdf' ? '#ef44441a' : 'var(--bg-secondary)', + display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 1, + transition: 'transform 0.12s, box-shadow 0.12s', + }} + onMouseEnter={e => { e.currentTarget.style.transform = 'scale(1.06)'; e.currentTarget.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)' }} + onMouseLeave={e => { e.currentTarget.style.transform = 'scale(1)'; e.currentTarget.style.boxShadow = 'none' }}> + {ext} +
+ )} + {a.original_name} +
+ ) + })} +
+
+ )}
,