From 47181dc790ae1e243d8e9890171c9e06c199ceef Mon Sep 17 00:00:00 2001 From: Smriti Doneria Date: Tue, 17 Dec 2024 13:10:28 +0530 Subject: [PATCH] fix quote --- .../src/views/QuoteMessage/QuoteMessage.js | 60 +++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) 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.name} (${(message.file.size / 1024).toFixed( + 2 + )} kB)`}
+
+ ) : message.file.type.startsWith('video/') ? ( + + ) : message.file.type.startsWith('audio/') ? ( + + ) : ( + + {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) => ( + + ))}
);