From 45083d29a6b2ac6e4260367a6db10ea76589dfde Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Fri, 28 Mar 2025 18:13:24 +0530 Subject: [PATCH] (feat:attach) show files on conversations --- .../src/conversation/ConversationBubble.tsx | 51 ++++++++++++++++--- .../src/conversation/ConversationMessages.tsx | 2 + .../src/conversation/conversationModels.ts | 4 +- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 8638718f..7bc042cf 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -56,6 +56,7 @@ const ConversationBubble = forwardRef< updated?: boolean, index?: number, ) => void; + attachments?: { fileName: string; id: string }[]; } >(function ConversationBubble( { @@ -69,6 +70,7 @@ const ConversationBubble = forwardRef< retryBtn, questionNumber, handleUpdatedQuestionSubmission, + attachments, }, ref, ) { @@ -95,6 +97,36 @@ const ConversationBubble = forwardRef< handleUpdatedQuestionSubmission?.(editInputBox, true, questionNumber); }; let bubble; + const renderAttachments = () => { + if (!attachments || attachments.length === 0) return null; + + return ( +
+ {attachments.map((attachment, index) => ( +
+ + + + {attachment.fileName} +
+ ))} +
+ ); + }; if (type === 'QUESTION') { bubble = (
{!isEditClicked && ( <> -
- {message} +
+
+ {message} +
+ {renderAttachments()}