import styled from '@emotion/styled'; import CrashContent from 'sentry/components/events/interfaces/crashContent'; import {t} from 'sentry/locale'; import {Group, PlatformType, Project} from 'sentry/types'; import {Event} from 'sentry/types/event'; import {STACK_TYPE, STACK_VIEW} from 'sentry/types/stacktrace'; import {TraceEventDataSection} from '../traceEventDataSection'; import CrashContentStackTrace from './crashContent/stackTrace'; import NoStackTraceMessage from './noStackTraceMessage'; import {isStacktraceNewestFirst} from './utils'; type CrashContentProps = React.ComponentProps; type Props = Pick< CrashContentProps, 'groupingCurrentLevel' | 'hasHierarchicalGrouping' > & { data: NonNullable; event: Event; projectId: Project['id']; type: string; groupingCurrentLevel?: Group['metadata']['current_level']; hideGuide?: boolean; }; function StackTrace({ projectId, event, data, type, hasHierarchicalGrouping, groupingCurrentLevel, }: Props) { function getPlatform(): PlatformType { const framePlatform = data.frames?.find(frame => !!frame.platform); return framePlatform?.platform ?? event.platform ?? 'other'; } const platform = getPlatform(); const stackTraceNotFound = !(data.frames ?? []).length; return ( {t('Stack Trace')}} wrapTitle={false} hasMinified={false} hasVerboseFunctionNames={ !!data.frames?.some( frame => !!frame.rawFunction && !!frame.function && frame.rawFunction !== frame.function ) } hasAbsoluteFilePaths={!!data.frames?.some(frame => !!frame.filename)} hasAbsoluteAddresses={!!data.frames?.some(frame => !!frame.instructionAddr)} hasAppOnlyFrames={!!data.frames?.some(frame => frame.inApp !== true)} hasNewestFirst={(data.frames ?? []).length > 1} showPermalink > {({recentFirst, display, fullStackTrace}) => stackTraceNotFound ? ( ) : ( ) } ); } export default StackTrace; const Title = styled('h3')` margin-bottom: 0; `;