Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ThumbUp,
Link as LinkIcon,
CheckCircle,
SquareTwoStack,
} from "@medusajs/icons"
import {
AiAssistantThreadItem as AiAssistantThreadItemType,
Expand All @@ -26,9 +27,12 @@ export const AiAssistantThreadItemActions = ({
const {
config: { baseUrl },
} = useSiteConfig()
const { handleCopy, isCopied } = useCopy(
const { handleCopy: handleLinkCopy, isCopied: isLinkCopied } = useCopy(
`${baseUrl}?query=${encodeURI(item.content)}`
)
const { handleCopy: handleAnswerCopy, isCopied: isAnswerCopied } = useCopy(
item.content
)

const handleFeedback = async (
reaction: Reaction,
Expand All @@ -55,8 +59,8 @@ export const AiAssistantThreadItemActions = ({
>
{item.type === "question" && (
<div className="flex gap-docs_0.25 items-center text-medusa-fg-muted">
<ActionButton onClick={handleCopy}>
{isCopied ? <CheckCircle /> : <LinkIcon />}
<ActionButton onClick={handleLinkCopy}>
{isLinkCopied ? <CheckCircle /> : <LinkIcon />}
</ActionButton>
</div>
)}
Expand All @@ -74,6 +78,9 @@ export const AiAssistantThreadItemActions = ({
</div>
)}
<div className="flex gap-docs_0.25 items-center text-medusa-fg-muted">
<ActionButton onClick={handleAnswerCopy}>
{isAnswerCopied ? <CheckCircle /> : <SquareTwoStack />}
</ActionButton>
{(feedback === null || feedback === "upvote") && (
<ActionButton
onClick={async () => handleFeedback("upvote", item.question_id)}
Expand Down
Loading