{"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
\n {children}\n
\n \n );\n}","import { useTranslation } from 'react-i18next';\nimport { Headline, HtmlContainer, Paragraph } from '../../ui';\nimport { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\ntype ErrorPageProps = { headline?: string; subheadline?: string; body?: string };\nconst ErrorPage = (props: ErrorPageProps): JSX.Element => {\n const { applicationId } = useApplicationIdContext(false, false);\n const { t } = useTranslation('common');\n const {\n headline = t('ApplicationLandingPages.Error.Headline'),\n subheadline = t('ApplicationLandingPages.Error.SubHeadline'),\n body = t('ApplicationLandingPages.Error.Body', ''),\n } = props;\n return (\n <>\n {headline}\n {subheadline}\n {body && }\n \n \n );\n};\n\nfunction ReloadLink({ applicationId }: { applicationId?: string }) {\n const { t } = useTranslation('common');\n const onClick = () => {\n location.replace(`${location.pathname}?applicationId?${applicationId}`);\n };\n\n return applicationId ? (\n \n
\n
\n \n {'< '} {t('Navigation.Back')}\n \n
\n ) : null;\n}\n\nexport default ErrorPage;\n"],"names":["ApplicationStatusPage","children","correctStateFunc","navigateToCorrectStepFunc","searchParams","useSearchParams","applicationId","applicantId","navigate","useNavigate","useEffect","fetchApplicationStatusAndRedirectIfNotExpectedState","jsx","style","ErrorPage","props","useApplicationIdContext","t","useTranslation","headline","subheadline","body","jsxs","Fragment","Headline","HtmlContainer","ReloadLink","onClick","Paragraph"],"mappings":"+JAiBO,MAAMA,EAAwB,CAAC,CAAC,SAAAC,EAAU,iBAAAC,EAAkB,0BAAAC,KAAgF,CACzI,KAAA,CAACC,CAAY,EAAIC,IAEjBC,EAAgBF,EAAa,IAAI,eAAe,EAChDG,EAAcH,EAAa,IAAI,aAAa,EAE5CI,EAAWC,IAEjBC,OAAAA,EAAAA,UAAU,IAAM,CAEZC,EAAoDL,EAAeC,GAAe,GAAIL,EAClF,IAAA,GAAiBM,EAAUL,CAAA,CAAyB,EAExD,CAACG,EAAeE,EAAUD,EAAaL,EAAkBC,CAAyB,CAAC,oBAG/E,SAACS,EAAA,IAAA,MAAA,CAAI,UAAWC,EAAM,QACjB,SAAAZ,CACL,CAAA,CACJ,CAAA,CAER,EClCMa,EAAaC,GAAuC,CACtD,KAAM,CAAE,cAAAT,CAAkB,EAAAU,EAAwB,GAAO,EAAK,EACxD,CAAE,EAAAC,CAAA,EAAMC,EAAe,QAAQ,EAC/B,CACF,SAAAC,EAAWF,EAAU,wCAAwC,EAC7D,YAAAG,EAAcH,EAAU,2CAA2C,EACnE,KAAAI,EAAOJ,EAAU,qCAAsC,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