focusArea.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import styled from '@emotion/styled';
  2. import {space} from 'sentry/styles/space';
  3. import useActiveReplayTab, {TabKey} from 'sentry/utils/replays/hooks/useActiveReplayTab';
  4. import A11y from 'sentry/views/replays/detail/accessibility/index';
  5. import Breadcrumbs from 'sentry/views/replays/detail/breadcrumbs';
  6. import Console from 'sentry/views/replays/detail/console';
  7. import DomNodesChart from 'sentry/views/replays/detail/domNodesChart';
  8. import ErrorList from 'sentry/views/replays/detail/errorList/index';
  9. import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
  10. import MemoryChart from 'sentry/views/replays/detail/memoryChart';
  11. import NetworkList from 'sentry/views/replays/detail/network';
  12. import PerfTable from 'sentry/views/replays/detail/perfTable/index';
  13. import TagPanel from 'sentry/views/replays/detail/tagPanel';
  14. import Trace from 'sentry/views/replays/detail/trace/index';
  15. type Props = {};
  16. function FocusArea({}: Props) {
  17. const {getActiveTab} = useActiveReplayTab();
  18. switch (getActiveTab()) {
  19. case TabKey.A11Y:
  20. return <A11y />;
  21. case TabKey.NETWORK:
  22. return <NetworkList />;
  23. case TabKey.TRACE:
  24. return <Trace />;
  25. case TabKey.PERF:
  26. return <PerfTable />;
  27. case TabKey.ERRORS:
  28. return <ErrorList />;
  29. case TabKey.MEMORY:
  30. return (
  31. <MemoryTabWrapper>
  32. <MemoryChart />
  33. <DomNodesChart />
  34. </MemoryTabWrapper>
  35. );
  36. case TabKey.CONSOLE:
  37. return <Console />;
  38. case TabKey.TAGS:
  39. return <TagPanel />;
  40. case TabKey.BREADCRUMBS:
  41. default: {
  42. return <Breadcrumbs />;
  43. }
  44. }
  45. }
  46. const MemoryTabWrapper = styled(FluidHeight)`
  47. justify-content: center;
  48. gap: ${space(1)};
  49. height: 100%;
  50. display: flex;
  51. `;
  52. export default FocusArea;