From dbd58402caeb727dbebab67ab591991c2502b223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ivind=20Stensrud?= Date: Wed, 18 Oct 2023 14:44:42 +0200 Subject: [PATCH] =?UTF-8?q?:ambulance:=20Legger=20tilbake=20fil=20som=20ik?= =?UTF-8?q?ke=20skulle=20ha=20v=C3=A6rt=20slettet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thomas Rognes Co-authored-by: Halvor Grizzly Bjørn Co-authored-by: Tor Idland --- pages/ettersendelse.tsx | 107 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 pages/ettersendelse.tsx diff --git a/pages/ettersendelse.tsx b/pages/ettersendelse.tsx new file mode 100644 index 0000000..96e20e7 --- /dev/null +++ b/pages/ettersendelse.tsx @@ -0,0 +1,107 @@ +import { ReadMore, Label, BodyShort, Button, Heading, Link } from '@navikt/ds-react'; +import PageHeader from 'components/PageHeader'; +import { Section } from 'components/Section/Section'; +import { beskyttetSide, getAccessToken } from '@navikt/aap-felles-utils'; +import { useFeatureToggleIntl } from 'lib/hooks/useFeatureToggleIntl'; +import { GetServerSidePropsResult, NextPageContext } from 'next'; +import * as styles from 'pages/[uuid]/ettersendelse/Ettersendelse.module.css'; +import NextLink from 'next/link'; +import { ArrowLeftIcon } from '@navikt/aksel-icons'; +import { useRouter } from 'next/router'; +import metrics from 'lib/metrics'; +import { getSøknader } from './api/soknader/soknader'; +import { LucaGuidePanel, ScanningGuide } from '@navikt/aap-felles-react'; +import { useIntl } from 'react-intl'; +import Head from 'next/head'; +import { FileUpload } from 'components/fileupload/FileUpload'; + +const Ettersendelse = () => { + const { formatMessage, formatElement } = useFeatureToggleIntl(); + const { locale } = useIntl(); + + const router = useRouter(); + + return ( + <> + + + {`${formatElement('ettersendelse.appTittel', { + shy: '', + })} - nav.no`} + + + + {formatElement('ettersendelse.appTittel', { + shy: <>­, + })} + +
+
+ + + + Tilbake til Mine Arbeidsavklaringspenger + + + + {formatMessage('ettersendelse.heading')} + + + {formatMessage('ettersendelse.annet.guide.tekst1')} + {formatMessage('ettersendelse.annet.guide.tekst2')} + +
+ + {formatMessage('ettersendelse.annet.tekst')} +
+
+ {formatMessage('ettersendelse.slikTarDuBildeBeskrivelse')} + + + +
+
+ + {}} + deleteError={() => {}} + setErrorSummaryFocus={() => {}} + onSuccess={() => {}} + /> +
+
+ +
+
+
+ + ); +}; + +export const getServerSideProps = beskyttetSide(async (ctx: NextPageContext): Promise> => { + const stopTimer = metrics.getServersidePropsDurationHistogram.startTimer({ + path: '/ettersendelse', + }); + const bearerToken = getAccessToken(ctx); + const params = { page: '0', size: '1', sort: 'created,desc' }; + const søknader = await getSøknader(params, bearerToken); + stopTimer(); + + if (søknader.length > 0) { + return { + redirect: { + destination: `/${søknader[0].søknadId}/ettersendelse/`, + permanent: false, + }, + }; + } + + return { + props: {}, + }; +}); + +export default Ettersendelse;