diff --git a/packages/react/src/views/QuoteMessage/QuoteMessage.js b/packages/react/src/views/QuoteMessage/QuoteMessage.js index 7012d3937..a21501f7a 100644 --- a/packages/react/src/views/QuoteMessage/QuoteMessage.js +++ b/packages/react/src/views/QuoteMessage/QuoteMessage.js @@ -54,13 +54,63 @@ const QuoteMessage = ({ className = '', style = {}, message }) => { {format(new Date(message.ts), 'h:mm a')} - {message.msg ? ( - + {message.file ? ( + message.file.type.startsWith('image/') ? ( + + + {`${message.file.name} (${(message.file.size / 1024).toFixed( + 2 + )} kB)`} + + ) : message.file.type.startsWith('video/') ? ( + + + Your browser does not support the video tag. + + ) : message.file.type.startsWith('audio/') ? ( + + + Your browser does not support the audio element. + + ) : ( + + {message.msg ? ( + + + ) : ( + `${message.file?.name} (${ + message.file?.size ? (message.file.size / 1024).toFixed(2) : 0 + } kB)` + )} + + ) + ) : message?.msg[0] === '[' ? ( + message?.msg.match(/\n(.*)/)[1] ) : ( - `${message.file?.name} (${ - message.file?.size ? (message.file.size / 1024).toFixed(2) : 0 - } kB)` + )} + {message.attachments && + message.attachments.length > 0 && + message.msg && + message.msg[0] === '[' && + message.attachments.map((attachment, index) => ( + + ))} );