From 544c46cd44190aa417a5b0914c8877e8087999dd Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Fri, 14 Jun 2024 00:31:33 +0100 Subject: [PATCH] chore: retry btn is side-by-side with error mssg --- frontend/src/conversation/Conversation.tsx | 23 ++++++++++++++++++- .../src/conversation/ConversationBubble.tsx | 12 +++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 42a14ad9..34b28c2f 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -19,6 +19,7 @@ import { FEEDBACK, Query } from './conversationModels'; import { sendFeedback } from './conversationApi'; import { useTranslation } from 'react-i18next'; import ArrowDown from './../assets/arrow-down.svg'; +import RetryIcon from '../components/RetryIcon'; export default function Conversation() { const queries = useSelector(selectQueries); const status = useSelector(selectStatus); @@ -151,13 +152,32 @@ export default function Conversation() { > ); } else if (query.error) { + const retryBtn = ( + + ); responseView = ( ); } @@ -213,6 +233,7 @@ export default function Conversation() { {queries.length === 0 && } +
void; sources?: { title: string; text: string; source: string }[]; + retryBtn?: React.ReactElement; } >(function ConversationBubble( - { message, type, className, feedback, handleFeedback, sources }, + { message, type, className, feedback, handleFeedback, sources, retryBtn }, ref, ) { const [openSource, setOpenSource] = useState(null); @@ -69,12 +70,17 @@ const ConversationBubble = forwardRef<
{type === 'ERROR' && ( - alert + <> + alert +
+ {retryBtn} +
+ )}