frameWalker.tsx 852 B

1234567891011121314151617181920212223242526272829
  1. import {memo} from 'react';
  2. import ChevronDividedList from 'sentry/components/replays/walker/chevronDividedList';
  3. import splitCrumbs from 'sentry/components/replays/walker/splitCrumbs';
  4. import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers';
  5. import type {ReplayFrame} from 'sentry/utils/replays/types';
  6. import type {ReplayRecord} from 'sentry/views/replays/types';
  7. type Props = {
  8. frames: ReplayFrame[];
  9. replayRecord: ReplayRecord;
  10. };
  11. const FrameWalker = memo(function FrameWalker({frames, replayRecord}: Props) {
  12. const startTimestampMs = replayRecord.started_at.getTime();
  13. const {handleClick} = useCrumbHandlers(startTimestampMs);
  14. return (
  15. <ChevronDividedList
  16. items={splitCrumbs({
  17. frames,
  18. startTimestampMs,
  19. onClick: handleClick,
  20. })}
  21. />
  22. );
  23. });
  24. export default FrameWalker;