-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4497 from navikt/feature/tilsagn-detaljer
Feature/tilsagn detaljer
- Loading branch information
Showing
10 changed files
with
278 additions
and
99 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
frontend/arrangor-flate/app/components/tilsagn/AFTTilsagnDetaljer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ArrangorflateTilsagn, TilsagnBeregningAFT } from "@mr/api-client"; | ||
import { Definisjonsliste } from "../Definisjonsliste"; | ||
import { formaterDato } from "~/utils"; | ||
import { formaterTall } from "@mr/frontend-common/utils/utils"; | ||
|
||
interface Props { | ||
tilsagn: ArrangorflateTilsagn; | ||
} | ||
|
||
export function AFTTilsagnDetaljer({ tilsagn }: Props) { | ||
const beregning = tilsagn.beregning as TilsagnBeregningAFT; | ||
|
||
return ( | ||
<Definisjonsliste | ||
className="mt-4" | ||
definitions={[ | ||
{ | ||
key: "Tilsagnsperiode", | ||
value: `${formaterDato(tilsagn.periodeStart)} - ${formaterDato(tilsagn.periodeSlutt)}`, | ||
}, | ||
{ key: "Tiltakstype", value: tilsagn.tiltakstype.navn }, | ||
{ key: "Tiltaksnavn", value: tilsagn.gjennomforing.navn }, | ||
{ key: "Antall plasser", value: String(beregning.antallPlasser) }, | ||
{ key: "Sats", value: formaterTall(beregning.sats) }, | ||
{ key: "Beløp", value: formaterTall(beregning.belop) }, | ||
{ key: "Beløp", value: formaterTall(beregning.belop) }, | ||
]} | ||
/> | ||
); | ||
} |
43 changes: 43 additions & 0 deletions
43
frontend/arrangor-flate/app/components/tilsagn/TilsagnDetaljer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ArrangorflateTilsagn, TilsagnBeregningAFT } from "@mr/api-client"; | ||
import { Definisjonsliste } from "../Definisjonsliste"; | ||
import { formaterDato } from "~/utils"; | ||
import { formaterTall } from "@mr/frontend-common/utils/utils"; | ||
|
||
interface Props { | ||
tilsagn: ArrangorflateTilsagn; | ||
} | ||
|
||
export function TilsagnDetaljer({ tilsagn }: Props) { | ||
return ( | ||
<> | ||
<Definisjonsliste | ||
className="mt-4" | ||
definitions={[ | ||
{ | ||
key: "Tilsagnsperiode", | ||
value: `${formaterDato(tilsagn.periodeStart)} - ${formaterDato(tilsagn.periodeSlutt)}`, | ||
}, | ||
{ key: "Beløp", value: formaterTall(tilsagn.beregning.belop) }, | ||
{ key: "Utbetalt så langt", value: formaterTall(0) }, | ||
]} | ||
/> | ||
{tilsagn.beregning.type === "AFT" ? ( | ||
<AFTDetaljer beregning={tilsagn.beregning} /> | ||
) : ( | ||
<div>Feil tilsagnstype</div> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
function AFTDetaljer({ beregning }: { beregning: TilsagnBeregningAFT }) { | ||
return ( | ||
<Definisjonsliste | ||
className="mt-4" | ||
definitions={[ | ||
{ key: "Antall plasser", value: String(beregning.antallPlasser) }, | ||
{ key: "Sats", value: formaterTall(beregning.sats) }, | ||
]} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.