import React from 'react'; import { StepAnalysisLinks } from './StepAnalysisLinks'; import { StepAnalysisDescription } from './StepAnalysisDescription'; import { StepAnalysisFormPane, StepAnalysisFormPluginState, StepAnalysisFormPluginProps } from './StepAnalysisFormPane'; import { StepAnalysisResultsPane, StepAnalysisResultState, StepAnalysisResultPluginProps } from './StepAnalysisResultsPane'; import { StepAnalysisEventHandlers } from './StepAnalysisView'; import { LoadingOverlay } from '../../Components'; export type StepAnalysisSelectedPaneProps = StepAnalysisSelectedPaneStateProps & StepAnalysisEventHandlers; export interface StepAnalysisSelectedPaneStateProps { analysisName: string; descriptionState: DescriptionState; formSaving: boolean; formState: StepAnalysisFormMetadata & StepAnalysisFormPluginState; resultState?: StepAnalysisResultState; pluginRenderers: PluginRenderers; } interface DescriptionState { shortDescription?: string; description?: string; descriptionExpanded: boolean; } interface StepAnalysisFormMetadata { hasParameters: boolean; formExpanded: boolean; errors: string[]; } interface PluginRenderers { formRenderer: (props: StepAnalysisFormPluginProps) => React.ReactNode; resultRenderer: (props: StepAnalysisResultPluginProps) => React.ReactNode; } export const StepAnalysisSelectedPane: React.SFC = ({ analysisName, descriptionState, formSaving, formState, resultState, toggleDescription, toggleParameters, updateParamValues, onFormSubmit, renameAnalysis, duplicateAnalysis, pluginRenderers: { formRenderer, resultRenderer } }) => { return (
{formSaving && ( Updating analysis... )}
{/* FIXME Make this configurable */ formState.hasParameters && <>

{analysisName}

}
{formState.hasParameters && } { resultState && }
); }