import {useMemo} from 'react'; import {useTheme} from '@emotion/react'; import styled from '@emotion/styled'; import {Button} from 'sentry/components/button'; import {CopyToClipboardButton} from 'sentry/components/copyToClipboardButton'; import { getStacktrace, StackTracePreviewContent, } from 'sentry/components/groupPreviewTooltip/stackTracePreview'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import {generateIssueEventTarget} from 'sentry/components/quickTrace/utils'; import {IconFire} from 'sentry/icons'; import {t} from 'sentry/locale'; import type {EventError} from 'sentry/types'; import {useApiQuery} from 'sentry/utils/queryClient'; import {useLocation} from 'sentry/utils/useLocation'; import type {TraceTreeNodeDetailsProps} from 'sentry/views/performance/newTraceDetails/traceDrawer/tabs/traceTreeNodeDetails'; import {getTraceTabTitle} from 'sentry/views/performance/newTraceDetails/traceTabs'; import {Row, Tags} from 'sentry/views/performance/traceDetails/styles'; import {makeTraceNodeBarColor, type TraceTree, type TraceTreeNode} from '../../traceTree'; import {IssueList} from './issues/issues'; import {TraceDrawerComponents} from './styles'; export function ErrorNodeDetails({ node, organization, scrollToNode, onParentClick, }: TraceTreeNodeDetailsProps>) { const location = useLocation(); const issues = useMemo(() => { return [...node.errors]; }, [node.errors]); const {isLoading, data} = useApiQuery( [ `/organizations/${organization.slug}/events/${node.value.project_slug}:${node.value.event_id}/`, ], { staleTime: 2 * 60 * 1000, } ); const stackTrace = useMemo(() => { if (data) { return getStacktrace(data); } return null; }, [data]); const theme = useTheme(); const parentTransaction = node.parent_transaction; return isLoading ? ( ) : data ? (
{t('error')}
{' '} {node.value.title}
{stackTrace ? ( {t('Stack Trace')} ) : ( {t('No stack trace has been reported with this error')} )} } > {node.value.title} {parentTransaction ? ( onParentClick(parentTransaction)}> {getTraceTabTitle(parentTransaction)} ) : null}
) : null; } const StackTraceWrapper = styled('td')` .traceback { margin-bottom: 0; border: 0; } `; const StackTraceTitle = styled('td')` font-weight: 600; font-size: 13px; width: 175px; `;