diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 7ae68e537100..1456a07dd003 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -83,6 +83,8 @@ import { LockOpenIcon, Undo2Icon, XIcon, + CopyIcon, + CheckIcon, } from "lucide-react"; import { Button } from "./ui/button"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "./ui/select"; @@ -2333,6 +2335,28 @@ const PendingApprovalsPanel = memo(function PendingApprovalsPanel({ ); }); +const MessageCopyButton = memo(function MessageCopyButton({ text }: { text: string }) { + const [copied, setCopied] = useState(false); + + const handleCopy = useCallback(() => { + void navigator.clipboard.writeText(text); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }, [text]); + + return ( + + ); +}); + interface MessagesTimelineProps { hasMessages: boolean; isWorking: boolean; @@ -2549,7 +2573,7 @@ const MessagesTimeline = memo(function MessagesTimeline({ const canRevertAgentWork = revertTurnCountByUserMessageId.has(row.message.id); return (
{formatTimestamp(row.message.createdAt)}