replayTableClipPlayer.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import ReplayClipPreviewPlayer from 'sentry/components/events/eventReplay/replayClipPreviewPlayer';
  2. import {StaticReplayPreferences} from 'sentry/components/replays/preferences/replayPreferences';
  3. import {Provider as ReplayContextProvider} from 'sentry/components/replays/replayContext';
  4. import useReplayReader from 'sentry/utils/replays/hooks/useReplayReader';
  5. type Props = {
  6. replaySlug: string;
  7. } & Omit<
  8. React.ComponentProps<typeof ReplayClipPreviewPlayer>,
  9. keyof ReturnType<typeof useReplayReader>
  10. >;
  11. function ReplayTableClipPlayer({analyticsContext, orgSlug, replaySlug, ...props}: Props) {
  12. const replayContext = useReplayReader({
  13. orgSlug,
  14. replaySlug,
  15. });
  16. const {fetching, replay} = replayContext;
  17. return (
  18. <ReplayContextProvider
  19. analyticsContext={analyticsContext}
  20. isFetching={fetching}
  21. prefsStrategy={StaticReplayPreferences}
  22. replay={replay}
  23. >
  24. <ReplayClipPreviewPlayer
  25. analyticsContext={analyticsContext}
  26. orgSlug={orgSlug}
  27. {...props}
  28. {...replayContext}
  29. />
  30. </ReplayContextProvider>
  31. );
  32. }
  33. export default ReplayTableClipPlayer;