focusArea.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 PerfTable from 'sentry/views/replays/detail/perfTable/index';
  9. import TagPanel from 'sentry/views/replays/detail/tagPanel';
  10. import Trace from 'sentry/views/replays/detail/trace/index';
  11. export default function FocusArea({isVideoReplay}: {isVideoReplay?: boolean}) {
  12. const {getActiveTab} = useActiveReplayTab({isVideoReplay});
  13. if (isVideoReplay) {
  14. switch (getActiveTab()) {
  15. case TabKey.ERRORS:
  16. return <ErrorList />;
  17. case TabKey.BREADCRUMBS:
  18. return <Breadcrumbs />;
  19. case TabKey.TAGS:
  20. default: {
  21. return <TagPanel />;
  22. }
  23. }
  24. }
  25. switch (getActiveTab()) {
  26. case TabKey.A11Y:
  27. return <A11y />;
  28. case TabKey.NETWORK:
  29. return <NetworkList />;
  30. case TabKey.TRACE:
  31. return <Trace />;
  32. case TabKey.PERF:
  33. return <PerfTable />;
  34. case TabKey.ERRORS:
  35. return <ErrorList />;
  36. case TabKey.MEMORY:
  37. return <MemoryPanel />;
  38. case TabKey.CONSOLE:
  39. return <Console />;
  40. case TabKey.TAGS:
  41. return <TagPanel />;
  42. case TabKey.BREADCRUMBS:
  43. default: {
  44. return <Breadcrumbs />;
  45. }
  46. }
  47. }