@@ -25,7 +25,7 @@ import {
2525} from 'sentry/components/events/autofix/useExplorerAutofix' ;
2626import { LoadingIndicator } from 'sentry/components/loadingIndicator' ;
2727import { TimeSince } from 'sentry/components/timeSince' ;
28- import { IconRefresh } from 'sentry/icons' ;
28+ import { IconCopy , IconRefresh } from 'sentry/icons' ;
2929import { IconBot } from 'sentry/icons/iconBot' ;
3030import { IconBug } from 'sentry/icons/iconBug' ;
3131import { IconCode } from 'sentry/icons/iconCode' ;
@@ -34,6 +34,7 @@ import {IconOpen} from 'sentry/icons/iconOpen';
3434import { IconPullRequest } from 'sentry/icons/iconPullRequest' ;
3535import { t , tct , tn } from 'sentry/locale' ;
3636import { defined } from 'sentry/utils' ;
37+ import { useCopyToClipboard } from 'sentry/utils/useCopyToClipboard' ;
3738import { FileDiffViewer } from 'sentry/views/seerExplorer/fileDiffViewer' ;
3839
3940interface AutofixCardProps {
@@ -259,6 +260,7 @@ export function PullRequestsCard({section}: AutofixCardProps) {
259260 const sectionArtifact = getAutofixArtifactFromSection ( section ) ;
260261 return isPullRequestsArtifact ( sectionArtifact ) ? sectionArtifact : null ;
261262 } , [ section ] ) ;
263+ const { copy} = useCopyToClipboard ( ) ;
262264
263265 return (
264266 < ArtifactCard icon = { < IconPullRequest /> } title = { t ( 'Pull Requests' ) } >
@@ -277,14 +279,22 @@ export function PullRequestsCard({section}: AutofixCardProps) {
277279 pullRequest . pr_number
278280 ) {
279281 return (
280- < LinkButton
281- key = { pullRequest . repo_name }
282- external
283- href = { pullRequest . pr_url }
284- priority = "primary"
285- >
286- { t ( 'View %s#%s' , pullRequest . repo_name , pullRequest . pr_number ) }
287- </ LinkButton >
282+ < Flex key = { pullRequest . repo_name } gap = "xs" align = "center" >
283+ < LinkButton external href = { pullRequest . pr_url } priority = "primary" >
284+ { t ( 'View %s#%s' , pullRequest . repo_name , pullRequest . pr_number ) }
285+ </ LinkButton >
286+ < Button
287+ priority = "primary"
288+ icon = { < IconCopy size = "xs" /> }
289+ aria-label = { t ( 'Copy PR URL' ) }
290+ tooltipProps = { { title : t ( 'Copy PR URL' ) } }
291+ onClick = { ( ) =>
292+ copy ( pullRequest . pr_url ! , {
293+ successMessage : t ( 'PR URL copied to clipboard.' ) ,
294+ } )
295+ }
296+ />
297+ </ Flex >
288298 ) ;
289299 }
290300
0 commit comments