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 = ({
progObj,
titleList,
currentSection,
documentListObj,
formObjXML,
mandatoryFieldsData,
gotoSection,
setCurrentSection,
props: outerProps,
}) => {
const { t } = useTranslation();
const router = useRouter();
const { locale } = router;
// Helper to safely access nested form values
const getFormValue = (field) =>
outerProps?.props?.form?.appealForm?.values?.[field];
const renderDocumentList = () => {
const formValues = outerProps?.props?.form?.appealForm?.values || {};
return (
<>
{t("newappeal:application-form")}
{formValues.pinswg_developmentdescriptionchanged === "true" && (
Description of development change confirmation
)}
{formValues.pinswg_caseworkreason === "846040005" && (
{t("newappeal:registration-of-application-letter")}
)}
{formValues.pinswg_caseworkreason === "846040000" && (
Decision notice
)}
{formValues.pinswg_attachsoc === "true" && (
{t("newappeal:statement-of-case")}
)}
{formValues.pinswg_attachcostapplication === "true" && (
{t("newappeal:cost-application")}
)}
{formValues.pinswg_s106unilateralsubmitted === "true" && (
Planning obligation (S106/Unilateral)
)}
{/* Additional document list items from documentListObj if needed */}
{/* {Object.entries(documentListObj).map(([key, value]) => (
{value}
))} */}
{t("newappeal:site-location-plan")}
>
);
};
return (
<>
{t("newappeal:new-appeal-documentlist-nav")}:
-
{renderDocumentList()}
>
);
};
const mapStateToProps = (state) => ({
search: state.search,
searchResultsObj: state.searchResultsObj,
formData: state.formData,
appealType: state.appealType,
initialValues: state.appealType.caseReference.caseDetails,
//form: state.form,
});
const mapDispatchToProps = (dispatch) => ({
gotoSection: (thisSection) => dispatch(setCurrentSection(thisSection)),
});
export default connect(mapStateToProps, mapDispatchToProps)(BuildProgress);