import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { connect } from "react-redux";
import { setCurrentSection } from "../../store/appealType/action";
import { FieldsTranslations } from "../elements";
const BuildProgress = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
progObj,
titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
} = props;
const parser = new DOMParser();
//const progObj = getProgressObj(
// formObjXML,
// titleList,
// mandatoryFieldsData,
// props
// );
//console.log(progObj);
return (
<>
{t("newappeal:new-appeal-documentlist-nav")}:
-
- {t("newappeal:application-form")}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty(
"pinswg_developmentdescriptionchanged"
)
? props.props.props.form["appealForm"]
.values
.pinswg_developmentdescriptionchanged ==
"true" && (
-
Description of development change
confirmation
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty("pinswg_caseworkreason")
? props.props.props.form["appealForm"]
.values.pinswg_caseworkreason ==
"846040005" && (
-
{t(
"newappeal:registration-of-application-letter"
)}
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty("pinswg_caseworkreason")
? props.props.props.form["appealForm"]
.values.pinswg_caseworkreason ==
"846040000" && (
- Decision notice
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty("pinswg_attachsoc")
? props.props.props.form["appealForm"]
.values.pinswg_attachsoc ==
"true" && (
-
{t("newappeal:statement-of-case")}
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty(
"pinswg_attachcostapplication"
)
? props.props.props.form["appealForm"]
.values
.pinswg_attachcostapplication ==
"true" && (
-
{t("newappeal:cost-application")}
)
: ""}
{props.props.props.form.hasOwnProperty(
"appealForm"
) &&
props.props.props.form[
"appealForm"
].hasOwnProperty("values") &&
props.props.props.form[
"appealForm"
].values.hasOwnProperty(
"pinswg_s106unilateralsubmitted"
)
? props.props.props.form["appealForm"]
.values
.pinswg_s106unilateralsubmitted ==
"true" && (
-
Planning obligation
(S106/Unilateral)
)
: ""}
{/* {Object.keys(documentListObj).length > 0 &&
Object.entries(documentListObj).map(
([key, value]) => {
return - {value}
;
}
)} */}
- {t("newappeal:site-location-plan")}
>
);
};
const mapStateToProps = (state) => {
return {
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
//form: state.form,
};
};
const mapDispatchToProps = (dispatch) => {
return {
gotoSection: (thisSection) => {
dispatch(setCurrentSection(thisSection));
},
};
};
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);