focusArea.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import useActiveReplayTab, {TabKey} from 'sentry/utils/replays/hooks/useActiveReplayTab';
  2. import Breadcrumbs from 'sentry/views/replays/detail/breadcrumbs';
  3. import Console from 'sentry/views/replays/detail/console';
  4. import ErrorList from 'sentry/views/replays/detail/errorList/index';
  5. import MemoryPanel from 'sentry/views/replays/detail/memoryPanel/index';
  6. import NetworkList from 'sentry/views/replays/detail/network';
  7. import TagPanel from 'sentry/views/replays/detail/tagPanel';
  8. import Trace from 'sentry/views/replays/detail/trace/index';
  9. import type {ReplayRecord} from '../../types';
  10. export default function FocusArea({
  11. isVideoReplay,
  12. replayRecord,
  13. }: {
  14. replayRecord: ReplayRecord | undefined;
  15. isVideoReplay?: boolean;
  16. }) {
  17. const {getActiveTab} = useActiveReplayTab({isVideoReplay});
  18. switch (getActiveTab()) {
  19. case TabKey.NETWORK:
  20. return <NetworkList />;
  21. case TabKey.TRACE:
  22. return <Trace replayRecord={replayRecord} />;
  23. case TabKey.ERRORS:
  24. return <ErrorList />;
  25. case TabKey.MEMORY:
  26. return <MemoryPanel />;
  27. case TabKey.CONSOLE:
  28. return <Console />;
  29. case TabKey.TAGS:
  30. return <TagPanel />;
  31. case TabKey.BREADCRUMBS:
  32. default: {
  33. return <Breadcrumbs />;
  34. }
  35. }
  36. }