replaySection.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. organization: Organization;
  11. replayId: string;
  12. }
  13. export default function ReplaySection({organization, replayId}: Props) {
  14. const replayPreview = useCallback(
  15. () => import('sentry/components/events/eventReplay/replayPreview'),
  16. []
  17. );
  18. return (
  19. <Section icon={<IconPlay size="xs" />} title={t('Linked Replay')}>
  20. <ErrorBoundary mini>
  21. <ReplayIdCountProvider organization={organization} replayIds={[replayId]}>
  22. <LazyLoad
  23. component={replayPreview}
  24. replaySlug={replayId}
  25. orgSlug={organization.slug}
  26. eventTimestampMs={0}
  27. buttonProps={{
  28. analyticsEventKey: 'issue_details.open_replay_details_clicked',
  29. analyticsEventName: 'Issue Details: Open Replay Details Clicked',
  30. analyticsParams: {
  31. organization,
  32. },
  33. }}
  34. />
  35. </ReplayIdCountProvider>
  36. </ErrorBoundary>
  37. </Section>
  38. );
  39. }