-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vis krav paa dagpenger i både behandling og kontroll
- Loading branch information
Showing
5 changed files
with
69 additions
and
63 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
app/components/krav-paa-dagpenger/KravPaaDagpenger.module.css
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,21 @@ | ||
.kravPaaDagpenger { | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-left: auto; | ||
padding: var(--a-spacing-2); | ||
box-shadow: inset 0 -1px 0 0 var(--a-border-divider); | ||
} | ||
|
||
.kravPaaDagpenger svg { | ||
margin-right: var(--a-spacing-1); | ||
} | ||
|
||
.kravPaaDagpengerSuccess { | ||
background-color: var(--a-green-100); | ||
} | ||
|
||
.kravPaaDagpengerError { | ||
background-color: var(--a-red-100); | ||
} |
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,42 @@ | ||
import { CheckmarkCircleFillIcon, XMarkOctagonFillIcon } from "@navikt/aksel-icons"; | ||
import classnames from "classnames"; | ||
|
||
import { useTypedRouteLoaderData } from "~/hooks/useTypedRouteLoaderData"; | ||
import type { IOpplysning } from "~/models/behandling.server"; | ||
|
||
import styles from "./KravPaaDagpenger.module.css"; | ||
|
||
export function KravPaaDagpenger() { | ||
const { behandling } = useTypedRouteLoaderData("routes/oppgave.$oppgaveId"); | ||
const harKravDagpengerOpplysning = finnOpplysningMedNavn( | ||
"Krav på dagpenger", | ||
behandling.opplysning, | ||
); | ||
return ( | ||
<div | ||
className={classnames(styles.kravPaaDagpenger, { | ||
[styles.kravPaaDagpengerSuccess]: harKravDagpengerOpplysning?.verdi === "true", | ||
[styles.kravPaaDagpengerError]: | ||
!harKravDagpengerOpplysning || harKravDagpengerOpplysning?.verdi === "false", | ||
})} | ||
> | ||
{harKravDagpengerOpplysning?.verdi === "true" && ( | ||
<> | ||
<CheckmarkCircleFillIcon color={"var(--a-green-500)"} /> | ||
Bruker har rett til dagpenger | ||
</> | ||
)} | ||
|
||
{(!harKravDagpengerOpplysning || harKravDagpengerOpplysning.verdi === "false") && ( | ||
<> | ||
<XMarkOctagonFillIcon color={"var(--a-red-500)"} /> | ||
Bruker har ikke rett til dagpenger | ||
</> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
function finnOpplysningMedNavn(navn: string, opplysninger: IOpplysning[]) { | ||
return opplysninger.find((opplysning) => opplysning.navn === navn); | ||
} |
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