This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
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.
Merge pull request #237 from navikt/fjerne_jobbkompetanseendepunkt
Fjern jobbsokerkompetanse-kallet
- Loading branch information
Showing
2 changed files
with
18 additions
and
60 deletions.
There are no files selected for viewing
49 changes: 2 additions & 47 deletions
49
src/components/paneler/innhold/jobbsokerkompetanse/jobbsokerkompetanse-panel-innhold.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 |
---|---|---|
@@ -1,52 +1,7 @@ | ||
import React from 'react'; | ||
import { useAppStore } from '../../../../stores/app-store'; | ||
import SistEndret from '../../../felles/sist-endret'; | ||
import Grid from '../../../felles/grid'; | ||
import InformasjonsbolkPunktliste from '../../../felles/informasjonsbolk-punktliste'; | ||
import Informasjonsbolk from '../../../felles/informasjonsbolk'; | ||
import { safeMap } from '../../../../utils'; | ||
import { RaadVisning } from './raad-visning'; | ||
import { useFetchJobbsokerkompetanse } from '../../../../rest/api'; | ||
import { Feilmelding, Laster, NoData } from '../../../felles/fetch'; | ||
import { isPending, hasError } from '@nutgaard/use-fetch'; | ||
import { hasData } from '../../../../rest/utils'; | ||
import { NoData } from '../../../felles/fetch'; | ||
|
||
const JobbsokerkompetansePanelInnhold = () => { | ||
const { fnr } = useAppStore(); | ||
const jobbsokerkompetanse = useFetchJobbsokerkompetanse(fnr); | ||
|
||
if (isPending(jobbsokerkompetanse)) { | ||
return <Laster midtstilt={true} />; | ||
} else if (hasError(jobbsokerkompetanse)) { | ||
return <Feilmelding />; | ||
} else if (!hasData(jobbsokerkompetanse)) { | ||
return <NoData />; | ||
} | ||
|
||
const { besvarelseDato, kulepunkter, raad } = jobbsokerkompetanse.data; | ||
const kulepunktListe = kulepunkter.map(punkt => punkt.kulepunkt); | ||
|
||
const raadliste = safeMap(raad, (rad, index) => ( | ||
<li key={index}> | ||
<RaadVisning raad={rad} /> | ||
</li> | ||
)); | ||
|
||
return ( | ||
<> | ||
<SistEndret sistEndret={besvarelseDato} onlyYearAndMonth={false} /> | ||
<Grid columns={1} gap="0rem"> | ||
<InformasjonsbolkPunktliste | ||
header="Dette gjør du bra" | ||
list={kulepunktListe} | ||
className="jobbsokerkompetanse__punktliste" | ||
/> | ||
<Informasjonsbolk header="Dette kan du gjøre bedre" className="jobbsokerkompetanse__raadliste"> | ||
<ul>{raadliste}</ul> | ||
</Informasjonsbolk> | ||
</Grid> | ||
</> | ||
); | ||
return <NoData />; | ||
}; | ||
|
||
export default JobbsokerkompetansePanelInnhold; |
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