💄 Laget mulighet for å skrive inn og submitte kommentar
This commit is contained in:
parent
01a84cdce9
commit
6f6399538e
2 changed files with 43 additions and 4 deletions
|
@ -46,7 +46,10 @@ const FeilKort = (props: IFeilKort) => {
|
||||||
arbeidsstatus={props.arbeidsstatus}
|
arbeidsstatus={props.arbeidsstatus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<FeilModal open={visModal} setOpen={setVisModal} >
|
<FeilModal
|
||||||
|
open={visModal}
|
||||||
|
setOpen={setVisModal}
|
||||||
|
>
|
||||||
{redigeringsmodus ?
|
{redigeringsmodus ?
|
||||||
<RedigeringsVerktoy
|
<RedigeringsVerktoy
|
||||||
id={props.id}
|
id={props.id}
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
import { PencilIcon, XMarkIcon } from "@navikt/aksel-icons"
|
import { ChatElipsisIcon, PencilIcon, XMarkIcon } from "@navikt/aksel-icons"
|
||||||
import { Button } from "@navikt/ds-react"
|
import { Button, Chat, TextField, Textarea } from "@navikt/ds-react"
|
||||||
import { FeilmeldingsInnholdInterface } from "../interface"
|
import { FeilmeldingsInnholdInterface } from "../interface"
|
||||||
import FeilkortHeader from "./FeilkortHeader"
|
import FeilkortHeader from "./FeilkortHeader"
|
||||||
|
import { useState } from "react"
|
||||||
|
|
||||||
|
|
||||||
const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => {
|
const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => {
|
||||||
|
const [kommentar, setKommentar] = useState("")
|
||||||
|
const [kommentarfelt, setKommentarfelt] = useState("")
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
|
@ -16,7 +21,7 @@ const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => {
|
||||||
arbeidsstatus={props.arbeidsstatus} />
|
arbeidsstatus={props.arbeidsstatus} />
|
||||||
<div className="flex gap-4 items-start">
|
<div className="flex gap-4 items-start">
|
||||||
<Button
|
<Button
|
||||||
variant="secondary"
|
variant="tertiary"
|
||||||
icon={<PencilIcon />}
|
icon={<PencilIcon />}
|
||||||
onClick={() => props.setRedigeringsmodus(true)}
|
onClick={() => props.setRedigeringsmodus(true)}
|
||||||
>
|
>
|
||||||
|
@ -35,7 +40,38 @@ const FeilmeldingsInnhold = (props: FeilmeldingsInnholdInterface) => {
|
||||||
</div>
|
</div>
|
||||||
<div className="h-2 bg-gray-200 my-4 rounded-lg"></div>
|
<div className="h-2 bg-gray-200 my-4 rounded-lg"></div>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
{kommentar.length === 0 ? <></> : (<Kommentar tekst={kommentar}/>)}
|
||||||
|
<div className="flex items-end gap-12 w-full mt-12">
|
||||||
|
<TextField
|
||||||
|
className="grow"
|
||||||
|
label="Skriv inn din kommentar til feilen"
|
||||||
|
value={kommentarfelt}
|
||||||
|
onChange={e => setKommentarfelt(e.target.value)}
|
||||||
|
>
|
||||||
|
|
||||||
|
</TextField>
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
icon={<ChatElipsisIcon/>}
|
||||||
|
onClick={() => {
|
||||||
|
setKommentar(kommentarfelt)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Legg til kommentar
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default FeilmeldingsInnhold;
|
export default FeilmeldingsInnhold;
|
||||||
|
|
||||||
|
|
||||||
|
const Kommentar = ({tekst} : {tekst: string}) => {
|
||||||
|
return(
|
||||||
|
<Chat>
|
||||||
|
<Chat.Bubble from="user" timestamp="10:00">
|
||||||
|
<p>{tekst}</p>
|
||||||
|
</Chat.Bubble>
|
||||||
|
</Chat>
|
||||||
|
)
|
||||||
|
}
|
Reference in a new issue