diff --git a/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/Bestillingsdata.tsx b/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/Bestillingsdata.tsx index f1463046e25..ee4624d9753 100644 --- a/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/Bestillingsdata.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/Bestillingsdata.tsx @@ -53,6 +53,8 @@ import { Medl } from '@/components/fagsystem/medl/bestilling/Medl' import { Udistub } from '@/components/fagsystem/udistub/bestilling/Udistub' import { Dokarkiv } from '@/components/fagsystem/dokarkiv/bestilling/Dokarkiv' import { Histark } from '@/components/fagsystem/histark/bestilling/Histark' +import { Foedested } from '@/components/fagsystem/pdlf/bestilling/partials/Foedested' +import { Foedselsdato } from '@/components/fagsystem/pdlf/bestilling/partials/Foedselsdato' export const BestillingTitle = styled.h4` margin: 5px 0 15px 0; @@ -84,6 +86,8 @@ export const Bestillingsdata = ({ bestilling }: any) => { return ( <> + + diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/bestilling/partials/Foedested.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/bestilling/partials/Foedested.tsx new file mode 100644 index 00000000000..f2d3fdf399e --- /dev/null +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/bestilling/partials/Foedested.tsx @@ -0,0 +1,51 @@ +import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' +import { BestillingTitle, EmptyObject } from '@/components/bestilling/sammendrag/Bestillingsdata' +import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' +import React from 'react' +import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils' +import { TitleValue } from '@/components/ui/titleValue/TitleValue' +import { AdresseKodeverk } from '@/config/kodeverk' +import { FoedestedData } from '@/components/fagsystem/pdlf/PdlTypes' + +type FoedestedTypes = { + foedestedListe: Array +} + +export const Foedested = ({ foedestedListe }: FoedestedTypes) => { + if (!foedestedListe || foedestedListe.length < 1) { + return null + } + + return ( +
+ + Fødested + + {(foedested: FoedestedData, idx: number) => { + return ( + + {isEmpty(foedested, ['kilde', 'master']) ? ( + + ) : ( + <> + + + + + )} + + ) + }} + + +
+ ) +} diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/bestilling/partials/Foedselsdato.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/bestilling/partials/Foedselsdato.tsx new file mode 100644 index 00000000000..2d554118d0e --- /dev/null +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/bestilling/partials/Foedselsdato.tsx @@ -0,0 +1,42 @@ +import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' +import { BestillingTitle, EmptyObject } from '@/components/bestilling/sammendrag/Bestillingsdata' +import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' +import { FoedselsdatoData } from '@/components/fagsystem/pdlf/PdlTypes' +import React from 'react' +import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils' +import { TitleValue } from '@/components/ui/titleValue/TitleValue' +import { formatDate } from '@/utils/DataFormatter' + +type FoedselsdatoTypes = { + foedselsdatoListe: Array +} + +export const Foedselsdato = ({ foedselsdatoListe }: FoedselsdatoTypes) => { + if (!foedselsdatoListe || foedselsdatoListe.length < 1) { + return null + } + + return ( +
+ + Fødselsdato + + {(foedselsdato: FoedselsdatoData, idx: number) => { + return ( + + {isEmpty(foedselsdato, ['kilde', 'master']) ? ( + + ) : ( + <> + + + + )} + + ) + }} + + +
+ ) +}