import type { CSSProperties } from 'react'; import React from 'react'; import type { HttpRequest } from '@yaakapp-internal/models'; import { SplitLayout } from './core/SplitLayout'; import { GraphQLDocsExplorer } from './GraphQLDocsExplorer'; import { HttpRequestPane } from './HttpRequestPane'; import { HttpResponsePane } from './HttpResponsePane'; import { useAtomValue } from 'jotai'; import { graphqlDocStateAtom } from '../atoms/graphqlSchemaAtom'; interface Props { activeRequest: HttpRequest; style: CSSProperties; } export function HttpRequestLayout({ activeRequest, style }: Props) { const { bodyType } = activeRequest; const isDocOpen = useAtomValue(graphqlDocStateAtom); return ( ( )} secondSlot={ bodyType === 'graphql' && isDocOpen ? () => ( ( )} secondSlot={() => } /> ) : ({ style }) => } /> ); }