1- import { Fragment , useCallback , useMemo , type CSSProperties } from 'react' ;
1+ import { Fragment , useCallback , type CSSProperties } from 'react' ;
22import { css , useTheme } from '@emotion/react' ;
33import styled from '@emotion/styled' ;
44// eslint-disable-next-line no-restricted-imports
@@ -8,9 +8,7 @@ import {Button} from '@sentry/scraps/button';
88import { Flex } from '@sentry/scraps/layout' ;
99import { ExternalLink } from '@sentry/scraps/link' ;
1010
11- import { useAutofixData } from 'sentry/components/events/autofix/useAutofix' ;
1211import { useActionableItemsWithProguardErrors } from 'sentry/components/events/interfaces/crashContent/exception/useActionableItems' ;
13- import { useGroupSummaryData } from 'sentry/components/group/groupSummary' ;
1412import TimeSince from 'sentry/components/timeSince' ;
1513import { IconCopy , IconWarning } from 'sentry/icons' ;
1614import { t } from 'sentry/locale' ;
@@ -29,10 +27,6 @@ import {Divider} from 'sentry/views/issueDetails/divider';
2927import EventCreatedTooltip from 'sentry/views/issueDetails/eventCreatedTooltip' ;
3028import { SectionKey } from 'sentry/views/issueDetails/streamline/context' ;
3129import { getFoldSectionKey } from 'sentry/views/issueDetails/streamline/foldSection' ;
32- import {
33- issueAndEventToMarkdown ,
34- useActiveThreadId ,
35- } from 'sentry/views/issueDetails/streamline/hooks/useCopyIssueDetails' ;
3630import { IssueDetailsJumpTo } from 'sentry/views/issueDetails/streamline/issueDetailsJumpTo' ;
3731
3832type EventNavigationProps = {
@@ -49,55 +43,6 @@ type EventNavigationProps = {
4943
5044export const MIN_NAV_HEIGHT = 44 ;
5145
52- function GroupMarkdownButton ( { group, event} : { event : Event ; group : Group } ) {
53- const organization = useOrganization ( ) ;
54- const activeThreadId = useActiveThreadId ( ) ;
55-
56- // Get data for markdown copy functionality
57- const { data : groupSummaryData } = useGroupSummaryData ( group ) ;
58- const { data : autofixData } = useAutofixData ( { groupId : group . id } ) ;
59-
60- const markdownText = useMemo ( ( ) => {
61- return issueAndEventToMarkdown (
62- group ,
63- event ,
64- groupSummaryData ,
65- autofixData ,
66- activeThreadId
67- ) ;
68- } , [ group , event , groupSummaryData , autofixData , activeThreadId ] ) ;
69-
70- const { copy} = useCopyToClipboard ( ) ;
71-
72- const handleCopyMarkdown = useCallback ( ( ) => {
73- copy ( markdownText , { successMessage : t ( 'Copied issue to clipboard as Markdown' ) } ) . then (
74- ( ) => {
75- trackAnalytics ( 'issue_details.copy_issue_details_as_markdown' , {
76- organization,
77- groupId : group . id ,
78- eventId : event ?. id ,
79- hasAutofix : Boolean ( autofixData ) ,
80- hasSummary : Boolean ( groupSummaryData ) ,
81- } ) ;
82- }
83- ) ;
84- } , [
85- copy ,
86- markdownText ,
87- organization ,
88- group . id ,
89- event ?. id ,
90- autofixData ,
91- groupSummaryData ,
92- ] ) ;
93-
94- return (
95- < MarkdownButton priority = "link" onClick = { handleCopyMarkdown } >
96- { t ( 'Copy as Markdown' ) }
97- </ MarkdownButton >
98- ) ;
99- }
100-
10146export function EventTitle ( { event, group, ref, ...props } : EventNavigationProps ) {
10247 const organization = useOrganization ( ) ;
10348 const theme = useTheme ( ) ;
@@ -172,8 +117,6 @@ export function EventTitle({event, group, ref, ...props}: EventNavigationProps)
172117 >
173118 { t ( 'JSON' ) }
174119 </ JsonLink >
175- < Divider />
176- < GroupMarkdownButton group = { group } event = { event } />
177120 </ Flex >
178121 { actionableItems && actionableItems . length > 0 && (
179122 < Fragment >
@@ -259,22 +202,6 @@ const JsonLink = styled(ExternalLink)`
259202 }
260203` ;
261204
262- const MarkdownButton = styled ( Button ) `
263- color: ${ p => p . theme . tokens . content . secondary } ;
264- text-decoration: underline;
265- text-decoration-color: ${ p => color ( p . theme . colors . gray400 ) . alpha ( 0.5 ) . string ( ) } ;
266- font-size: inherit;
267- font-weight: normal;
268- cursor: pointer;
269- white-space: nowrap;
270-
271- :hover {
272- color: ${ p => p . theme . tokens . content . secondary } ;
273- text-decoration: underline;
274- text-decoration-color: ${ p => p . theme . tokens . content . secondary } ;
275- }
276- ` ;
277-
278205const EventIdWrapper = styled ( 'div' ) `
279206 display: flex;
280207 gap: ${ p => p . theme . space [ '2xs' ] } ;
0 commit comments