diff --git a/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessageFile.tsx b/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessageFile.tsx index 705af4e12..293548975 100644 --- a/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessageFile.tsx +++ b/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessageFile.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useMemo } from 'react'; import { BusterChatMessageReasoning_file, BusterChatMessageReasoning_files @@ -7,6 +7,10 @@ import { useMessageIndividual } from '@/context/Chats'; import { ReasoningFileButtons } from './ReasoningFileButtons'; import { StreamingMessageCode } from '@/components/ui/streaming/StreamingMessageCode'; import isEmpty from 'lodash/isEmpty'; +import { Text } from '@/components/ui/typography'; +import { CircleSpinnerLoader } from '@/components/ui/loaders'; +import { CheckDouble, AlertWarning } from '@/components/ui/icons'; +import { AnimatePresence, motion } from 'framer-motion'; export type ReasoningMessageFileProps = { chatId: string; @@ -29,8 +33,9 @@ export const ReasoningMessage_File: React.FC = React. if (isEmpty(file)) return null; const { status, file_type, version_id } = file; - const isLoading = status === 'loading'; - const buttons = isLoading ? undefined : ( + const buttons = !isCompletedStream ? ( + + ) : ( ); @@ -41,3 +46,42 @@ export const ReasoningMessage_File: React.FC = React. ); ReasoningMessage_File.displayName = 'ReasoningMessage_File'; + +const StreamingMessageStatus = React.memo( + ({ status }: { status: BusterChatMessageReasoning_file['status'] }) => { + const content = useMemo(() => { + if (status === 'loading') + return ( + + Running SQL... + + ); + if (status === 'completed') + return ( + + Completed + + ); + if (status === 'failed') + return ( + + Failed + + ); + }, [status]); + + return ( + + + {content} + + + ); + } +); + +StreamingMessageStatus.displayName = 'StreamingMessageStatus';