File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use client' ;
22
3+ import { useState } from 'react' ;
4+ import { Copy , Check } from 'lucide-react' ;
5+ import { Button } from '@/components/ui/button' ;
36import {
47 Table ,
58 TableBody ,
@@ -11,6 +14,36 @@ import {
1114import { Badge } from '@/components/ui/badge' ;
1215import { ReflexionRun } from '@prisma/client' ;
1316
17+ function CopyRunIdButton ( { runId } : { runId : string } ) {
18+ const [ copied , setCopied ] = useState ( false ) ;
19+
20+ const handleCopy = async ( ) => {
21+ try {
22+ await navigator . clipboard . writeText ( runId ) ;
23+ setCopied ( true ) ;
24+ setTimeout ( ( ) => setCopied ( false ) , 2000 ) ;
25+ } catch ( err ) {
26+ console . error ( 'Failed to copy text: ' , err ) ;
27+ }
28+ } ;
29+
30+ return (
31+ < Button
32+ variant = "ghost"
33+ size = "icon-xs"
34+ onClick = { handleCopy }
35+ title = "Copy Run ID"
36+ className = "text-muted-foreground hover:text-foreground h-5 w-5 p-0"
37+ >
38+ { copied ? (
39+ < Check className = "size-3 text-emerald-500" />
40+ ) : (
41+ < Copy className = "size-3" />
42+ ) }
43+ </ Button >
44+ ) ;
45+ }
46+
1447interface ReflexionRunsTableProps {
1548 runs : ReflexionRun [ ] ;
1649}
@@ -57,7 +90,10 @@ export function ReflexionRunsTable({ runs }: ReflexionRunsTableProps) {
5790 return (
5891 < TableRow key = { run . id } >
5992 < TableCell className = "font-mono text-xs text-muted-foreground" >
60- { shortId }
93+ < div className = "flex items-center gap-1.5" >
94+ < span > { shortId } </ span >
95+ < CopyRunIdButton runId = { run . id } />
96+ </ div >
6197 </ TableCell >
6298 < TableCell className = "font-medium" title = { run . brief } >
6399 { truncatedBrief }
You can’t perform that action at this time.
0 commit comments