Skip to content

Commit

Permalink
implemented copy message warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ruoccofabrizio committed Oct 11, 2023
1 parent 81bc750 commit c48bd83
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/src/components/Answer/Answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ export const Answer = ({
return citationFilename;
}

useEffect(() => {
const handleCopy = () => {
alert("Please consider where you paste this content.");
};
document.addEventListener("copy", handleCopy);
return () => {
document.removeEventListener("copy", handleCopy);
};
}, []);

return (
<>
<Stack className={styles.answerContainer}>
Expand Down

0 comments on commit c48bd83

Please sign in to comment.