refactor appeal for new and resume
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
// 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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user