🎨 Dele opp feilkort (#23)
* 🎨 Laget RedigeringsVerktøy komponent * 🎨 Laget Innholdskomponent
This commit is contained in:
parent
9528f6cfbf
commit
89954388b4
3 changed files with 167 additions and 118 deletions
48
frontend/src/components/FeilmeldingsInnhold.tsx
Normal file
48
frontend/src/components/FeilmeldingsInnhold.tsx
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import { PencilIcon, XMarkIcon } from "@navikt/aksel-icons"
|
||||
import { Button } from "@navikt/ds-react"
|
||||
import { IFeilmelding } from "../interface"
|
||||
import FeilkortHeader from "./FeilkortHeader"
|
||||
|
||||
|
||||
interface FeilmeldingsInnholdInterface extends IFeilmelding {
|
||||
children: React.ReactNode
|
||||
setVisModal: (visModal: boolean) => void
|
||||
setRedigeringsmodus: (redigeringsmodus: boolean) => void
|
||||
}
|
||||
|
||||
const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => {
|
||||
return(
|
||||
<div>
|
||||
<div className="flex justify-between">
|
||||
<FeilkortHeader
|
||||
id={props.id}
|
||||
tittel={props.tittel}
|
||||
beskrivelse={props.beskrivelse}
|
||||
dato={props.dato}
|
||||
haster={props.haster}
|
||||
arbeidsstatus={props.arbeidsstatus} />
|
||||
<div className="flex gap-4 items-start">
|
||||
<Button
|
||||
variant="secondary"
|
||||
icon={<PencilIcon />}
|
||||
onClick={() => props.setRedigeringsmodus(true)}
|
||||
>
|
||||
Rediger
|
||||
</Button>
|
||||
<Button
|
||||
icon={<XMarkIcon />}
|
||||
onClick={() => {
|
||||
props.setVisModal(false)
|
||||
props.setRedigeringsmodus(false)
|
||||
}}
|
||||
>
|
||||
Lukk
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="h-2 bg-gray-200 my-4 rounded-lg"></div>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default FeilmeldingsInnhold;
|
||||
Reference in a new issue