index.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {Fragment} from 'react';
  2. import DetailsSplitDivider from 'sentry/components/replays/virtualizedGrid/detailsSplitDivider';
  3. import type {SpanFrame} from 'sentry/utils/replays/types';
  4. import type {useResizableDrawer} from 'sentry/utils/useResizableDrawer';
  5. import useUrlParams from 'sentry/utils/useUrlParams';
  6. import NetworkDetailsContent from 'sentry/views/replays/detail/network/details/content';
  7. import type {TabKey} from 'sentry/views/replays/detail/network/details/tabs';
  8. import NetworkDetailsTabs from 'sentry/views/replays/detail/network/details/tabs';
  9. type Props = {
  10. isSetup: boolean;
  11. item: null | SpanFrame;
  12. onClose: () => void;
  13. projectId: undefined | string;
  14. startTimestampMs: number;
  15. } & Omit<ReturnType<typeof useResizableDrawer>, 'size'>;
  16. function NetworkDetails({
  17. isHeld,
  18. isSetup,
  19. item,
  20. onClose,
  21. onDoubleClick,
  22. onMouseDown,
  23. projectId,
  24. startTimestampMs,
  25. }: Props) {
  26. const {getParamValue: getDetailTab} = useUrlParams('n_detail_tab', 'details');
  27. if (!item || !projectId) {
  28. return null;
  29. }
  30. const visibleTab = getDetailTab() as TabKey;
  31. return (
  32. <Fragment>
  33. <DetailsSplitDivider
  34. isHeld={isHeld}
  35. onClose={onClose}
  36. onDoubleClick={onDoubleClick}
  37. onMouseDown={onMouseDown}
  38. >
  39. <NetworkDetailsTabs underlined={false} />
  40. </DetailsSplitDivider>
  41. <NetworkDetailsContent
  42. isSetup={isSetup}
  43. item={item}
  44. projectId={projectId}
  45. startTimestampMs={startTimestampMs}
  46. visibleTab={visibleTab}
  47. />
  48. </Fragment>
  49. );
  50. }
  51. export default NetworkDetails;