@@ -4,7 +4,7 @@ import Badge from "@leafygreen-ui/badge";
4
4
import Banner from "@leafygreen-ui/banner" ;
5
5
// import Card from "@leafygreen-ui/card";
6
6
import Box from "@leafygreen-ui/box" ;
7
- import { Subtitle , Body , Link } from "@leafygreen-ui/typography" ;
7
+ import { Subtitle , Body , Link , InlineCode } from "@leafygreen-ui/typography" ;
8
8
import useConversation , { Conversation } from "./useConversation" ;
9
9
import { CSSTransition } from "react-transition-group" ;
10
10
import { useClickAway } from "@uidotdev/usehooks" ;
@@ -44,7 +44,7 @@ function ErrorBanner() {
44
44
return (
45
45
< Banner className = { styles . lg_banner } variant = "danger" >
46
46
Something went wrong. Try reloading the page and starting a new
47
- conversation.
47
+ conversation.
48
48
</ Banner >
49
49
) ;
50
50
}
@@ -58,6 +58,16 @@ function VerifyInformationBanner() {
58
58
) ;
59
59
}
60
60
61
+ function ConversationIdInfo ( { conversation } : { conversation : Conversation } ) {
62
+ return import . meta. env . VITE_QA ? (
63
+ < div >
64
+ < Body >
65
+ Conversation ID: < InlineCode > { conversation . conversationId } </ InlineCode >
66
+ </ Body >
67
+ </ div >
68
+ ) : null ;
69
+ }
70
+
61
71
type CTACardProps = {
62
72
active : boolean ;
63
73
cardRef : React . RefObject < HTMLDivElement > ;
@@ -96,6 +106,7 @@ function CTACard({
96
106
< Box ref = { cardRef } className = { styles . card } >
97
107
{ active && ! isEmptyConversation ? (
98
108
< >
109
+ < ConversationIdInfo conversation = { conversation } />
99
110
< div className = { styles . card_content_title } >
100
111
< Subtitle > MongoDB AI</ Subtitle >
101
112
< Badge variant = "blue" > Experimental</ Badge >
@@ -112,7 +123,8 @@ function CTACard({
112
123
< MessageList >
113
124
{ conversation . messages . map ( ( message ) => {
114
125
const showLoadingSkeleton = conversation . isStreamingMessage
115
- ? message . id === conversation . streamingMessage ?. id && conversation . streamingMessage ?. content === ""
126
+ ? message . id === conversation . streamingMessage ?. id &&
127
+ conversation . streamingMessage ?. content === ""
116
128
: awaitingReply ;
117
129
return showLoadingSkeleton ? (
118
130
< Message key = { message . id } role = "assistant" >
@@ -131,7 +143,7 @@ function CTACard({
131
143
) : null }
132
144
133
145
{ active && conversation . error ? < ErrorBanner /> : null }
134
-
146
+
135
147
{ active ? < VerifyInformationBanner /> : null }
136
148
137
149
{ ! active || ! conversation . error ? (
0 commit comments