import {useMemo} from 'react'; import {useTheme} from '@emotion/react'; import styled from '@emotion/styled'; import {LinkButton} from 'sentry/components/button'; import { getStacktrace, StackTracePreviewContent, } from 'sentry/components/groupPreviewTooltip/stackTracePreview'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import {generateIssueEventTarget} from 'sentry/components/quickTrace/utils'; import {t} from 'sentry/locale'; import type {EventError} from 'sentry/types/event'; import {useApiQuery} from 'sentry/utils/queryClient'; import {TraceIcons} from 'sentry/views/performance/newTraceDetails/icons'; import type {TraceTreeNodeDetailsProps} from 'sentry/views/performance/newTraceDetails/traceDrawer/tabs/traceTreeNodeDetails'; import {getTraceTabTitle} from 'sentry/views/performance/newTraceDetails/traceState/traceTabs'; import { makeTraceNodeBarColor, type TraceTree, type TraceTreeNode, } from '../../traceModels/traceTree'; import {IssueList} from './issues/issues'; import {type SectionCardKeyValueList, TraceDrawerComponents} from './styles'; export function ErrorNodeDetails({ node, organization, onTabScrollToNode, onParentClick, }: TraceTreeNodeDetailsProps>) { const issues = useMemo(() => { return [...node.errors]; }, [node.errors]); const {isPending, 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; const items: SectionCardKeyValueList = [ { key: 'title', subject: t('Title'), value: , }, ]; if (parentTransaction) { items.push({ key: 'parent_transaction', subject: t('Parent Transaction'), value: ( onParentClick(parentTransaction)}> {getTraceTabTitle(parentTransaction)} ), }); } return isPending ? ( ) : data ? (
{node.value.level ?? t('error')}
{t('Go to Issue')}
) : ( t('No stack trace has been reported with this error') ), }, ]} title={t('Stack Trace')} />
) : null; } const StackTraceWrapper = styled('div')` .traceback { margin-bottom: 0; border: 0; } `;