1
1
import React from 'react' ;
2
2
import { useFieldArray , useFormContext } from 'react-hook-form' ;
3
3
4
- import { BodyShort , Label , Tag } from '@navikt/ds-react' ;
4
+ import { BodyShort , Table , Tag } from '@navikt/ds-react' ;
5
5
6
6
import { TextAreaField } from '@navikt/ft-form-hooks' ;
7
7
import { required } from '@navikt/ft-form-validators' ;
8
8
import { AssessedBy } from '@navikt/ft-plattform-komponenter' ;
9
9
10
- import { EditedIcon , PeriodLabel , Table , TableColumn , TableRow , VerticalSpacer } from '@navikt/ft-ui-komponenter' ;
10
+ import { EditedIcon , PeriodLabel , VerticalSpacer } from '@navikt/ft-ui-komponenter' ;
11
11
import { formatCurrencyWithKr } from '@navikt/ft-utils' ;
12
12
13
13
import { type TilkommetAktivitetFormValues } from '../../types/FordelBeregningsgrunnlagPanelValues' ;
@@ -70,11 +70,6 @@ export const TilkommetAktivitetField = ({
70
70
harInntektsforholdMedÅrsinntekt ? 'Årsinntekt' : ' ' ,
71
71
harInntektsforholdMedPeriode ? 'Inntektsperiode' : ' ' ,
72
72
] ;
73
- const headerComponents = headerTexts . map ( text => (
74
- < Label size = "small" key = { text } >
75
- { `${ text } ` }
76
- </ Label >
77
- ) ) ;
78
73
79
74
const getInntektsforholdTableRows = ( inntektsforholdPeriode : VurderInntektsforholdPeriode ) : React . ReactElement [ ] => {
80
75
const tableRows : React . ReactElement [ ] = [ ] ;
@@ -84,14 +79,14 @@ export const TilkommetAktivitetField = ({
84
79
const harInntektsmelding = erDefinert ( inntektsforhold . inntektFraInntektsmeldingPrÅr ) ;
85
80
86
81
tableRows . push (
87
- < TableRow key = { inntektsforhold . arbeidsgiverId || inntektsforhold . aktivitetStatus } >
88
- < TableColumn >
82
+ < Table . Row key = { inntektsforhold . arbeidsgiverId || inntektsforhold . aktivitetStatus } >
83
+ < Table . DataCell >
89
84
< BodyShort size = "small" >
90
85
{ getAktivitetNavnFraInnteksforhold ( inntektsforhold , arbeidsgiverOpplysningerPerId ) }
91
86
</ BodyShort >
92
- </ TableColumn >
87
+ </ Table . DataCell >
93
88
{ ( harBruttoInntekt || harInntektsmelding || harInntektsforholdMedPeriode ) && (
94
- < TableColumn className = { styles . inntektColumn } >
89
+ < Table . DataCell className = { styles . inntektColumn } >
95
90
< BodyShort size = "small" >
96
91
{ harBruttoInntekt && ! harInntektsmelding && (
97
92
< >
@@ -108,25 +103,34 @@ export const TilkommetAktivitetField = ({
108
103
</ >
109
104
) }
110
105
</ BodyShort >
111
- </ TableColumn >
106
+ </ Table . DataCell >
112
107
) }
113
108
{ inntektsforhold . periode && (
114
- < TableColumn >
109
+ < Table . DataCell >
115
110
< BodyShort size = "small" >
116
111
< PeriodLabel dateStringFom = { inntektsforhold . periode . fom } dateStringTom = { inntektsforhold . periode . tom } />
117
112
</ BodyShort >
118
- </ TableColumn >
113
+ </ Table . DataCell >
119
114
) }
120
- </ TableRow > ,
115
+ </ Table . Row > ,
121
116
) ;
122
117
} ) ;
123
118
return tableRows ;
124
119
} ;
125
120
return (
126
121
< >
127
122
< div className = { styles . aktivitetContainer } >
128
- < Table noHover headerColumnContent = { headerComponents } classNameTable = { styles . aktivitetTable } >
129
- { getInntektsforholdTableRows ( vurderInntektsforholdPeriode ) }
123
+ < Table size = "small" className = { styles . aktivitetTable } >
124
+ < Table . Header >
125
+ < Table . Row >
126
+ { headerTexts . map ( text => (
127
+ < Table . HeaderCell scope = "col" key = { text } >
128
+ { text }
129
+ </ Table . HeaderCell >
130
+ ) ) }
131
+ </ Table . Row >
132
+ </ Table . Header >
133
+ < Table . Body > { getInntektsforholdTableRows ( vurderInntektsforholdPeriode ) } </ Table . Body >
130
134
</ Table >
131
135
</ div >
132
136
< VerticalSpacer sixteenPx />
0 commit comments