-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CREATE: CreateRiskoscenario componet
Co-authored-by: Jeremiah Uy <[email protected]>
- Loading branch information
1 parent
3b2b252
commit bbf3902
Showing
2 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
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
68 changes: 68 additions & 0 deletions
68
apps/frontend/src/components/PvkDokument/edit/CreateRisikoscenario.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,68 @@ | ||
import { Button, Heading, Radio, RadioGroup, ReadMore, TextField } from '@navikt/ds-react' | ||
import { useState } from 'react' | ||
import { ESannsynlighetsnivaa } from '../../../constants' | ||
import { TextAreaField } from '../../common/Inputs' | ||
|
||
export const CreateRisikoscenario = () => { | ||
const [isEdit, setIsEdit] = useState<boolean>(false) | ||
return ( | ||
<div className="mt-5"> | ||
{!isEdit && ( | ||
<Button onClick={() => setIsEdit(true)} variant="secondary"> | ||
Opprett nytt generelt risikoscenario | ||
</Button> | ||
)} | ||
|
||
{isEdit && ( | ||
<div> | ||
<Heading level="2" size="small" className="mb-3"> | ||
Opprett nytt generelt risikoscenario | ||
</Heading> | ||
|
||
<TextField | ||
label="Navngi risikoscenarioet" | ||
description="Velg et navn som gjør scenarioet lett å skille fra andre " | ||
/> | ||
|
||
<div className="mt-3"> | ||
<TextAreaField | ||
rows={3} | ||
noPlaceholder | ||
label="Beskriv risikoscenarioet" | ||
name="genereltRisikoscenarioBeskrivelse" | ||
/> | ||
</div> | ||
|
||
<Heading level="2" size="small" className="mb-3"> | ||
Risikoscenarioets sannsynlighet | ||
</Heading> | ||
|
||
<ReadMore header="Hva menes med de ulike sannsynlighetsnivåene?" className="mt-5"> | ||
???????? | ||
</ReadMore> | ||
|
||
<RadioGroup legend="Vurdér risikoscenarioets sannsynlighetsnivå"> | ||
<Radio value={ESannsynlighetsnivaa.MEGET_LITE_SANNSYNILIG}>Meget lite sannsynlig</Radio> | ||
<Radio value={ESannsynlighetsnivaa.LITE_SANNSYNLIG}>Lite sannsynlig</Radio> | ||
<Radio value={ESannsynlighetsnivaa.MODERAT_SANNSYNLIG}>Moderat sannsynlig </Radio> | ||
<Radio value={ESannsynlighetsnivaa.SANNSYNLIG}>Sannsynlig</Radio> | ||
<Radio value={ESannsynlighetsnivaa.NESTEN_SIKKERT}>Nesten sikkert</Radio> | ||
</RadioGroup> | ||
|
||
<div className="mt-3"> | ||
<TextAreaField rows={3} noPlaceholder label="Begrunn sannsynlighetsnivået" name="WIP" /> | ||
</div> | ||
|
||
<div className="flex gap-2 mt-5"> | ||
<Button type="button">Lagre risikoscenario</Button> | ||
<Button onClick={() => setIsEdit(false)} type="button" variant="secondary"> | ||
Avbryt, ikke lagre | ||
</Button> | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default CreateRisikoscenario |