focusArea.tsx 1.3 KB

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