@@ -6,8 +6,9 @@ import text from "@common/constants/texts";
6
6
import { useBehandlingProvider } from "@common/context/BehandlingContext" ;
7
7
import { QueryKeys , useGetBehandlingV2 , useGetBeregningBidrag } from "@common/hooks/useApiData" ;
8
8
import useFeatureToogle from "@common/hooks/useFeatureToggle" ;
9
+ import { ExternalLinkIcon } from "@navikt/aksel-icons" ;
9
10
import { dateToDDMMYYYYString , deductDays } from "@navikt/bidrag-ui-common" ;
10
- import { Alert , BodyShort , Heading , Table } from "@navikt/ds-react" ;
11
+ import { Alert , BodyShort , Heading , Link , Table } from "@navikt/ds-react" ;
11
12
import { useQueryClient } from "@tanstack/react-query" ;
12
13
import React , { Fragment , useEffect } from "react" ;
13
14
@@ -22,6 +23,7 @@ import {
22
23
import PersonNavnIdent from "../../../common/components/PersonNavnIdent" ;
23
24
import { RolleTag } from "../../../common/components/RolleTag" ;
24
25
import { ResultatDescription } from "../../../common/components/vedtak/ResultatDescription" ;
26
+ import { useQueryParams } from "../../../common/hooks/useQueryParams" ;
25
27
import { hentVisningsnavn } from "../../../common/hooks/useVisningsnavn" ;
26
28
import { VedtakBarnebidragBeregningResult } from "../../../types/vedtakTypes" ;
27
29
import { formatterBeløpForBeregning , formatterProsent } from "../../../utils/number-utils" ;
@@ -51,9 +53,12 @@ const Vedtak = () => {
51
53
</ div >
52
54
< div className = "grid gap-y-2" >
53
55
{ ! beregning ?. feil && (
54
- < Heading level = "3" size = "small" >
55
- { text . title . oppsummering }
56
- </ Heading >
56
+ < div className = "flex flex-row" >
57
+ < Heading level = "3" size = "small" >
58
+ { text . title . oppsummering }
59
+ </ Heading >
60
+ < GrunnlagFraVedtakButton />
61
+ </ div >
57
62
) }
58
63
59
64
< VedtakResultat />
@@ -70,6 +75,23 @@ const Vedtak = () => {
70
75
) ;
71
76
} ;
72
77
78
+ const GrunnlagFraVedtakButton = ( ) => {
79
+ const { grunnlagFraVedtaksid, saksnummer } = useGetBehandlingV2 ( ) ;
80
+ const enhet = useQueryParams ( ) . get ( "enhet" ) ;
81
+ const sessionState = useQueryParams ( ) . get ( "sessionState" ) ;
82
+
83
+ if ( ! grunnlagFraVedtaksid ) return null ;
84
+ return (
85
+ < Link
86
+ className = "ml-auto"
87
+ href = { `/sak/${ saksnummer } /vedtak/${ grunnlagFraVedtaksid } /?steg=vedtak&enhet=${ enhet } &sessionState=${ sessionState } ` }
88
+ target = "_blank"
89
+ rel = "noreferrer"
90
+ >
91
+ Grunnlag fra vedtak < ExternalLinkIcon aria-hidden />
92
+ </ Link >
93
+ ) ;
94
+ } ;
73
95
const VedtakUgyldigBeregning = ( { resultat } : { resultat : ResultatBidragsberegningBarnDto } ) => {
74
96
if ( ! resultat . ugyldigBeregning ) return null ;
75
97
return (
0 commit comments