replaySection.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {useCallback} from 'react';
  2. import ErrorBoundary from 'sentry/components/errorBoundary';
  3. import Section from 'sentry/components/feedback/feedbackItem/feedbackItemSection';
  4. import LazyLoad from 'sentry/components/lazyLoad';
  5. import ReplayIdCountProvider from 'sentry/components/replays/replayIdCountProvider';
  6. import {IconPlay} from 'sentry/icons';
  7. import {t} from 'sentry/locale';
  8. import {Organization} from 'sentry/types';
  9. interface Props {
  10. eventTimestampMs: number;
  11. organization: Organization;
  12. replayId: string;
  13. }
  14. export default function ReplaySection({eventTimestampMs, organization, replayId}: Props) {
  15. const replayPreview = useCallback(
  16. () => import('sentry/components/events/eventReplay/replayPreview'),
  17. []
  18. );
  19. return (
  20. <Section icon={<IconPlay size="xs" />} title={t('Linked Replay')}>
  21. <ErrorBoundary mini>
  22. <ReplayIdCountProvider organization={organization} replayIds={[replayId]}>
  23. <LazyLoad
  24. component={replayPreview}
  25. replaySlug={replayId}
  26. orgSlug={organization.slug}
  27. eventTimestampMs={eventTimestampMs}
  28. buttonProps={{
  29. analyticsEventKey: 'issue_details.open_replay_details_clicked',
  30. analyticsEventName: 'Issue Details: Open Replay Details Clicked',
  31. analyticsParams: {
  32. organization,
  33. },
  34. }}
  35. />
  36. </ReplayIdCountProvider>
  37. </ErrorBoundary>
  38. </Section>
  39. );
  40. }