summaryrefslogtreecommitdiff
path: root/frontend/src/components/Sidebar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/Sidebar.tsx')
-rw-r--r--frontend/src/components/Sidebar.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx
index b73c513..ac48c6f 100644
--- a/frontend/src/components/Sidebar.tsx
+++ b/frontend/src/components/Sidebar.tsx
@@ -17,7 +17,7 @@ const preprocessLaTeX = (content: string): string => {
.replace(/\\\(([\s\S]*?)\\\)/g, (_, math) => `$${math}$`);
};
-import { Play, Settings, Info, ChevronLeft, ChevronRight, Maximize2, Edit3, X, Check, FileText, MessageCircle, Send, GripVertical, GitMerge, Trash2, AlertCircle, Loader2, Navigation, Upload, Search, Link, Layers, Eye, EyeOff } from 'lucide-react';
+import { Play, Settings, Info, ChevronLeft, ChevronRight, Maximize2, Edit3, X, Check, FileText, MessageCircle, Send, GripVertical, GitMerge, Trash2, AlertCircle, Loader2, Navigation, Upload, Search, Link, Layers, Eye, EyeOff, Copy, ClipboardCheck } from 'lucide-react';
interface SidebarProps {
isOpen: boolean;
@@ -56,6 +56,7 @@ const Sidebar: React.FC<SidebarProps> = ({ isOpen, onToggle, onInteract }) => {
const [isEditing, setIsEditing] = useState(false);
const [editedResponse, setEditedResponse] = useState('');
const [rawTextMode, setRawTextMode] = useState(false);
+ const [copiedResponse, setCopiedResponse] = useState(false);
// Summary states
const [showSummaryModal, setShowSummaryModal] = useState(false);
@@ -1856,6 +1857,17 @@ const Sidebar: React.FC<SidebarProps> = ({ isOpen, onToggle, onInteract }) => {
{selectedNode.data.response && (
<>
<button
+ onClick={() => {
+ navigator.clipboard.writeText(selectedNode.data.response || '');
+ setCopiedResponse(true);
+ setTimeout(() => setCopiedResponse(false), 1500);
+ }}
+ className={`p-1 rounded ${isDark ? 'text-gray-400 hover:bg-gray-700' : 'text-gray-500 hover:bg-gray-200'}`}
+ title="Copy response"
+ >
+ {copiedResponse ? <ClipboardCheck size={14} className="text-green-500" /> : <Copy size={14} />}
+ </button>
+ <button
onClick={() => setRawTextMode(!rawTextMode)}
className={`p-1 rounded ${rawTextMode
? (isDark ? 'bg-blue-900/50 text-blue-400' : 'bg-blue-100 text-blue-600')