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

View File

@@ -59,7 +59,7 @@ const ConversationBubble = forwardRef<
updated?: boolean,
index?: number,
) => void;
attachmentsMetadata?: { id: string; fileName: string }[];
filesAttached?: { id: string; fileName: string }[];
}
>(function ConversationBubble(
{
@@ -75,7 +75,7 @@ const ConversationBubble = forwardRef<
questionNumber,
isStreaming,
handleUpdatedQuestionSubmission,
attachmentsMetadata,
filesAttached,
},
ref,
) {
@@ -109,9 +109,9 @@ const ConversationBubble = forwardRef<
onMouseLeave={() => setIsQuestionHovered(false)}
>
<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">
{attachmentsMetadata.map((attachment, index) => (
{filesAttached.map((file, index) => (
<div
key={index}
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>
<span className="max-w-[150px] truncate font-normal">
{attachment.fileName}
{file.fileName}
</span>
</div>
))}

View File

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