(feat:attach) renaming, semantic identifier names

This commit is contained in:
ManishMadan2882
2025-06-06 21:52:10 +05:30
parent 50248cc9ea
commit 4862548e65
3 changed files with 8 additions and 8 deletions

View File

@@ -109,7 +109,7 @@ export default function Conversation() {
const trimmedQuestion = question.trim(); const trimmedQuestion = question.trim();
if (trimmedQuestion === '') return; if (trimmedQuestion === '') return;
const attachmentMetadata = attachments const filesAttached = attachments
.filter((a) => a.id && a.status === 'completed') .filter((a) => a.id && a.status === 'completed')
.map((a) => ({ id: a.id as string, fileName: a.fileName })); .map((a) => ({ id: a.id as string, fileName: a.fileName }));
@@ -121,7 +121,7 @@ export default function Conversation() {
dispatch( dispatch(
addQuery({ addQuery({
prompt: trimmedQuestion, prompt: trimmedQuestion,
attachments: attachmentMetadata, attachments: filesAttached,
}), }),
); );
handleFetchAnswer({ question: trimmedQuestion, index }); handleFetchAnswer({ question: trimmedQuestion, index });

View File

@@ -59,7 +59,7 @@ const ConversationBubble = forwardRef<
updated?: boolean, updated?: boolean,
index?: number, index?: number,
) => void; ) => void;
attachmentsMetadata?: { id: string; fileName: string }[]; filesAttached?: { id: string; fileName: string }[];
} }
>(function ConversationBubble( >(function ConversationBubble(
{ {
@@ -75,7 +75,7 @@ const ConversationBubble = forwardRef<
questionNumber, questionNumber,
isStreaming, isStreaming,
handleUpdatedQuestionSubmission, handleUpdatedQuestionSubmission,
attachmentsMetadata, filesAttached,
}, },
ref, ref,
) { ) {
@@ -109,9 +109,9 @@ const ConversationBubble = forwardRef<
onMouseLeave={() => setIsQuestionHovered(false)} onMouseLeave={() => setIsQuestionHovered(false)}
> >
<div className="flex flex-col items-end"> <div className="flex flex-col items-end">
{attachmentsMetadata && attachmentsMetadata.length > 0 && ( {filesAttached && filesAttached.length > 0 && (
<div className="mb-2 mr-12 flex flex-wrap justify-end gap-2"> <div className="mb-2 mr-12 flex flex-wrap justify-end gap-2">
{attachmentsMetadata.map((attachment, index) => ( {filesAttached.map((file, index) => (
<div <div
key={index} key={index}
className="flex items-center rounded-xl bg-[#EFF3F4] p-2 text-[14px] text-[#5D5D5D] dark:bg-[#393B3D] dark:text-bright-gray" className="flex items-center rounded-xl bg-[#EFF3F4] p-2 text-[14px] text-[#5D5D5D] dark:bg-[#393B3D] dark:text-bright-gray"
@@ -124,7 +124,7 @@ const ConversationBubble = forwardRef<
/> />
</div> </div>
<span className="max-w-[150px] truncate font-normal"> <span className="max-w-[150px] truncate font-normal">
{attachment.fileName} {file.fileName}
</span> </span>
</div> </div>
))} ))}

View File

@@ -223,7 +223,7 @@ export default function ConversationMessages({
handleUpdatedQuestionSubmission={handleQuestionSubmission} handleUpdatedQuestionSubmission={handleQuestionSubmission}
questionNumber={index} questionNumber={index}
sources={query.sources} sources={query.sources}
attachmentsMetadata={query.attachments} filesAttached={query.attachments}
/> />
{renderResponseView(query, index)} {renderResponseView(query, index)}
</Fragment> </Fragment>