index.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import ErrorBoundary from 'sentry/components/errorBoundary';
  2. import {ExceptionType, Group, PlatformKey, Project} from 'sentry/types';
  3. import {Event} from 'sentry/types/event';
  4. import {StackType, StackView} from 'sentry/types/stacktrace';
  5. import {Content} from './content';
  6. import RawContent from './rawContent';
  7. type Props = {
  8. event: Event;
  9. hasHierarchicalGrouping: boolean;
  10. newestFirst: boolean;
  11. platform: PlatformKey;
  12. projectSlug: Project['slug'];
  13. stackType: StackType;
  14. groupingCurrentLevel?: Group['metadata']['current_level'];
  15. meta?: Record<any, any>;
  16. stackView?: StackView;
  17. threadId?: number;
  18. } & Pick<ExceptionType, 'values'>;
  19. export function ExceptionContent({
  20. stackView,
  21. stackType,
  22. projectSlug,
  23. values,
  24. event,
  25. newestFirst,
  26. hasHierarchicalGrouping,
  27. groupingCurrentLevel,
  28. platform = 'other',
  29. meta,
  30. threadId,
  31. }: Props) {
  32. return (
  33. <ErrorBoundary mini>
  34. {stackView === StackView.RAW ? (
  35. <RawContent
  36. eventId={event.id}
  37. projectSlug={projectSlug}
  38. type={stackType}
  39. values={values}
  40. platform={platform}
  41. />
  42. ) : (
  43. <Content
  44. type={stackType}
  45. stackView={stackView}
  46. values={values}
  47. platform={platform}
  48. projectSlug={projectSlug}
  49. newestFirst={newestFirst}
  50. event={event}
  51. hasHierarchicalGrouping={hasHierarchicalGrouping}
  52. groupingCurrentLevel={groupingCurrentLevel}
  53. meta={meta}
  54. threadId={threadId}
  55. />
  56. )}
  57. </ErrorBoundary>
  58. );
  59. }