replayTableClipPlayer.tsx 996 B

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