✨ Knapp i redigeringsverktøy for sletting av feil
This commit is contained in:
parent
2f58fb9df6
commit
2d9397b270
1 changed files with 21 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
import { FloppydiskIcon, XMarkIcon } from "@navikt/aksel-icons"
|
||||
import { FloppydiskIcon, TrashIcon, XMarkIcon } from "@navikt/aksel-icons"
|
||||
import { TextField, Textarea, RadioGroup, Radio, Button, Switch, Heading } from "@navikt/ds-react"
|
||||
import { useState } from "react"
|
||||
import { FeilmeldingsInnholdInterface } from "../interface"
|
||||
|
@ -102,8 +102,28 @@ const RedigeringsVerktoy = (props: redigeringsInterface) => {
|
|||
>
|
||||
Avbryt
|
||||
</Button>
|
||||
<SlettFeilKnapp id={props.id}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default RedigeringsVerktoy;
|
||||
|
||||
|
||||
|
||||
|
||||
const SlettFeilKnapp = (props: {id : number}) => {
|
||||
const SlettFeil = () => {
|
||||
axios.delete(`/api/slettfeil/${props.id}`)
|
||||
}
|
||||
|
||||
return(
|
||||
<Button
|
||||
variant="danger"
|
||||
icon={<TrashIcon/>}
|
||||
onClick={SlettFeil}
|
||||
>
|
||||
Slett feil
|
||||
</Button>
|
||||
)
|
||||
}
|
Reference in a new issue