File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
lib/user-interface/react-app/src/components/chatbot Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 3
3
Container ,
4
4
Spinner ,
5
5
TextContent ,
6
+ Button ,
7
+ Popover ,
8
+ StatusIndicator ,
6
9
} from "@cloudscape-design/components" ;
7
10
import { useContext , useEffect , useState , useCallback } from "react" ;
8
11
import ReactMarkdown from "react-markdown" ;
@@ -212,6 +215,30 @@ export default function ChatMessage(props: ChatMessageProps) {
212
215
)
213
216
}
214
217
>
218
+ { props . message . content . length > 0 && (
219
+ < div className = { styles . btn_chabot_message_copy } >
220
+ < Popover
221
+ data-locator = "copy-clipboard"
222
+ size = "medium"
223
+ position = "top"
224
+ triggerType = "custom"
225
+ dismissButton = { false }
226
+ content = {
227
+ < StatusIndicator type = "success" >
228
+ Copied to clipboard
229
+ </ StatusIndicator >
230
+ }
231
+ >
232
+ < Button
233
+ variant = "inline-icon"
234
+ iconName = "copy"
235
+ onClick = { ( ) => {
236
+ navigator . clipboard . writeText ( props . message . content ) ;
237
+ } }
238
+ />
239
+ </ Popover >
240
+ </ div >
241
+ ) }
215
242
{ loading ||
216
243
( content . length === 0 && ! processingAsyncFiles && ! files . length ) ? (
217
244
< Box >
You can’t perform that action at this time.
0 commit comments