{"version":3,"file":"index-0ebabdf2.js","sources":["../../../client-app/src/common/components/ApplicationStatusPage/index.tsx","../../../client-app/src/common/applicationPages/ErrorPage/index.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useSearchParams, useNavigate, NavigateFunction } from \"react-router-dom\";\nimport { fetchApplicationStatusAndRedirectIfNotExpectedState } from \"../../applicationPages/applicationStatusHelpers\";\nimport { ApplicationStatusModel } from \"../../serverGeneratedTypings/applicationStatusModel\";\nimport style from \"./style.module.scss\";\n\nexport type CommonStatusPageProps = {\n navigateToCorrectStepFunc : (application: ApplicationStatusModel, applicantId: string, navigate: NavigateFunction) => void;\n}\n\ntype ApplicationStatusPageProps = {\n correctStateFunc: (applicationStatus: ApplicationStatusModel) => boolean;\n navigateToCorrectStepFunc : (application: ApplicationStatusModel, applicantId: string, navigate: NavigateFunction) => void;\n};\n\ntype ApplicationStatusPagePropsCombined = React.PropsWithChildren & ApplicationStatusPageProps;\n\nexport const ApplicationStatusPage = ({children, correctStateFunc, navigateToCorrectStepFunc}: ApplicationStatusPagePropsCombined): JSX.Element => {\n const [searchParams] = useSearchParams();\n\n const applicationId = searchParams.get(\"applicationId\"); \n const applicantId = searchParams.get(\"applicantId\"); \n\n const navigate = useNavigate();\n \n useEffect(() => {\n \n fetchApplicationStatusAndRedirectIfNotExpectedState(applicationId, applicantId || \"\", correctStateFunc, \n () => undefined, navigate, navigateToCorrectStepFunc);\n\n }, [applicationId, navigate, applicantId, correctStateFunc, navigateToCorrectStepFunc]); \n\n return (<>\n