Skip to content

Commit

Permalink
PR to implement copy to clipboard functionality to AAP virtual assist…
Browse files Browse the repository at this point in the history
…ant (#1450)

* copy to clipboard functionality

* fix build

* fix prettier build

* fix

* fix review
  • Loading branch information
justjais authored Dec 9, 2024
1 parent 4fa0e53 commit c8b6f03
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ansible_ai_connect_chatbot/src/useChatbot/useChatbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ export const useChatbot = () => {
}
},
},
copy: {
onClick: () => {
if (message.actions) {
message.actions.copy.className = "action-button-clicked";
navigator.clipboard.writeText(
typeof response === "object" ? response.response : response,
);
}
},
},
};
return message;
};
Expand Down

0 comments on commit c8b6f03

Please sign in to comment.