File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
www/packages/docs-ui/src/components/AiAssistant/ThreadItem/Actions Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 66 ThumbUp ,
77 Link as LinkIcon ,
88 CheckCircle ,
9+ SquareTwoStack ,
910} from "@medusajs/icons"
1011import {
1112 AiAssistantThreadItem as AiAssistantThreadItemType ,
@@ -26,9 +27,12 @@ export const AiAssistantThreadItemActions = ({
2627 const {
2728 config : { baseUrl } ,
2829 } = useSiteConfig ( )
29- const { handleCopy, isCopied } = useCopy (
30+ const { handleCopy : handleLinkCopy , isCopied : isLinkCopied } = useCopy (
3031 `${ baseUrl } ?query=${ encodeURI ( item . content ) } `
3132 )
33+ const { handleCopy : handleAnswerCopy , isCopied : isAnswerCopied } = useCopy (
34+ item . content
35+ )
3236
3337 const handleFeedback = async (
3438 reaction : Reaction ,
@@ -55,8 +59,8 @@ export const AiAssistantThreadItemActions = ({
5559 >
5660 { item . type === "question" && (
5761 < div className = "flex gap-docs_0.25 items-center text-medusa-fg-muted" >
58- < ActionButton onClick = { handleCopy } >
59- { isCopied ? < CheckCircle /> : < LinkIcon /> }
62+ < ActionButton onClick = { handleLinkCopy } >
63+ { isLinkCopied ? < CheckCircle /> : < LinkIcon /> }
6064 </ ActionButton >
6165 </ div >
6266 ) }
@@ -74,6 +78,9 @@ export const AiAssistantThreadItemActions = ({
7478 </ div >
7579 ) }
7680 < div className = "flex gap-docs_0.25 items-center text-medusa-fg-muted" >
81+ < ActionButton onClick = { handleAnswerCopy } >
82+ { isAnswerCopied ? < CheckCircle /> : < SquareTwoStack /> }
83+ </ ActionButton >
7784 { ( feedback === null || feedback === "upvote" ) && (
7885 < ActionButton
7986 onClick = { async ( ) => handleFeedback ( "upvote" , item . question_id ) }
You can’t perform that action at this time.
0 commit comments