(null);
+ const [copied, setCopied] = useState(false);
+
+ const handleCopyClick = (text: string) => {
+ copy(text);
+ setCopied(true);
+ // Reset copied to false after a few seconds
+ setTimeout(() => {
+ setCopied(false);
+ }, 2000);
+ };
+
const List = ({
ordered,
children,
@@ -140,6 +152,22 @@ const ConversationBubble = forwardRef<
+
+ {copied ? (
+
+ ) : (
+ {
+ handleCopyClick(message);
+ }}
+ >
+ )}
+
- copy(message)}
- >