import React, { useState } from 'react' import { SlideModal, Label, Icon } from 'UI'; import { connect } from 'react-redux' import cn from 'classnames'; import NetworkContent from '../../../Session_/Network/NetworkContent' import FetchDetails from '../../../Session_/Fetch/FetchDetails'; import stl from './networkTab.css'; const HEEADER_HEIGHT = 590; function NetworkTab(props) { const { run, className } = props; const requests = run.resources; const [current, setCurrent] = useState(null); const [currentIndex, setCurrentIndex] = useState(0); const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) - HEEADER_HEIGHT; const downloadHarFile = () => { window.open(run.harfile); } const nextClickHander = () => { const requests = run.resources; if (currentIndex === requests.length - 1) return; const newIndex = currentIndex + 1; setCurrent(requests[newIndex]); setCurrentIndex(newIndex); } const prevClickHander = () => { const requests = run.resources; if (currentIndex === 0) return; const newIndex = currentIndex - 1; setCurrent(requests[newIndex]); setCurrentIndex(newIndex); } return (

Fetch Request

Status
} isDisplayed={ current != null } content={ current && } onClose={ () => setCurrent(null) } />
HAR Reports
{ setCurrent(e); setCurrentIndex(index)} } additionalHeight={vh} fetchPresented = { run.fetchPresented } loadTime = { run.loadTime } domBuildingTime = { run.domBuildingTime } resourcesSize = { run.resourcesSize } transferredSize = { run.transferredSize } domContentLoadedTime = { run.domContentLoadedTime } /> ) } export default connect(state => ({ requests: state.getIn([ 'tests', 'sampleRun', 'resources']) }))(NetworkTab)