49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
// components/newappeal/NewAppealFlow.js
|
|
import React from "react";
|
|
import BuildCheckSection from "./buildchecksection";
|
|
import BuildSection from "./buildsection";
|
|
import CompleteAppeal from "./complete";
|
|
import { SECTION_COMPLETE } from "./constants";
|
|
|
|
export default function NewAppealFlow({
|
|
formXML,
|
|
sectionCount,
|
|
currentSection,
|
|
onSubmit,
|
|
formTitle,
|
|
mandatoryFieldsData,
|
|
propsForChildren,
|
|
docsOffline,
|
|
}) {
|
|
if (currentSection === SECTION_COMPLETE) {
|
|
return <CompleteAppeal props={propsForChildren} />;
|
|
}
|
|
|
|
if (currentSection === sectionCount + 1) {
|
|
return (
|
|
<BuildCheckSection
|
|
formXML={formXML}
|
|
sectionCount={sectionCount}
|
|
onSubmit={onSubmit}
|
|
formTitle={formTitle}
|
|
appealType={propsForChildren.appealType}
|
|
props={propsForChildren}
|
|
key={1}
|
|
mandatoryFieldsData={mandatoryFieldsData}
|
|
docsOffline={docsOffline}
|
|
/>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<BuildSection
|
|
formXML={formXML}
|
|
sectionCount={sectionCount}
|
|
onSubmit={onSubmit}
|
|
formTitle={formTitle}
|
|
mandatoryFieldsData={mandatoryFieldsData}
|
|
props={propsForChildren}
|
|
/>
|
|
);
|
|
}
|