import { FloppydiskIcon, 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" import axios from "axios" import Skillelinje from "./Skillelinje" interface redigeringsInterface extends FeilmeldingsInnholdInterface { reset: () => void } const RedigeringsVerktoy = (props: redigeringsInterface) => { const [tittel, setTittel] = useState(props.tittel) const [beskrivelse, setBeskrivelse] = useState(props.beskrivelse) const [arbeidsstatus, setArbeidsstatus] = useState(props.arbeidsstatus) const [haster, setHaster] = useState(props.haster) const lagreEndringer = async() => { props.setVisModal(false) props.setRedigeringsmodus(false) const payload = { id: props.id, tittel: tittel, beskrivelse: beskrivelse, dato: props.dato.toISOString().replace('Z', ''), arbeidsstatus: arbeidsstatus, haster: haster, } await axios.put(`/api/oppdaterfeil/`, payload, { headers: { 'Content-Type': 'application/json' } }).then((response) => { console.log(response); }).catch((error) => { console.log(error); }) props.reset() } return (