import cs from 'classnames' import * as React from 'react' import SplitPane from 'react-split-pane' import { Message, namedObserver, eventManager as EventManager, Header } from '@packages/runner-shared' import { Iframes } from '../iframe/iframes' import { animationFrameDebounce } from '../lib/debounce' import { KeyboardHelper } from './KeyboardHelper' import { NoSpec } from './NoSpec' import { Plugins } from './Plugins' import { ReporterContainer } from './ReporterContainer' import { PLUGIN_BAR_HEIGHT } from './RunnerCt' import State from '../lib/state' import { hideIfScreenshotting, hideReporterIfNecessary } from '../lib/hideGuard' import styles from './RunnerCt.module.scss' interface SpecContentProps { state: State eventManager: typeof EventManager config: { configFile: string [key: string]: unknown } } interface SpecContentWrapperProps { state: State onSplitPaneChange: (newSize: number) => void } export const SpecContent = namedObserver('SpecContent', (props: SpecContentProps) => { function updatePluginsHeight (height: number) { props.state.updatePluginsHeight(height) } return ( props.state.isAnyDevtoolsPluginOpen ? props.state.pluginsHeight // show the small not resize-able panel with buttons or nothing : props.state.isAnyPluginToShow ? PLUGIN_BAR_HEIGHT : 0)} onChange={animationFrameDebounce(updatePluginsHeight)} >
{props.state.spec ? : ( )}
props.state.pluginsHeight)} />
) }) const SpecContentWrapper = namedObserver('SpecContentWrapper', (props: React.PropsWithChildren) => { const updateReporterWidth = (width: number) => { props.state.updateReporterWidth(width) } if (props.state.spec) { return ( 100)} maxSize={hideReporterIfNecessary(props.state, () => 600)} defaultSize={hideReporterIfNecessary(props.state, () => props.state.reporterWidth)} className='primary' onChange={animationFrameDebounce(updateReporterWidth)} > {props.children} ) } return (
{props.children}
) })