-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrkestratorOpplysningLinje.tsx
42 lines (39 loc) · 1.41 KB
/
OrkestratorOpplysningLinje.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { FormScope } from "@rvf/remix";
import { IOrkestratorBarnOpplysning } from "~/models/orkestrator-opplysning.server";
import {
formatterOrkestratorOpplysningVerdi,
hentOrkestratorBarnOpplysningLabel,
} from "~/utils/orkestrator-opplysninger.utils";
import { OrkestratorOpplysning } from "../orkestrator-opplysning/OrkestratorOpplysning";
import styles from "./OrkestratorBarn.module.css";
import { OrkestratorTag } from "./OrkestratorTag";
import classNames from "classnames";
interface IProps {
opplysning: IOrkestratorBarnOpplysning;
readOnly?: boolean;
formScope: FormScope<string>;
}
export function OrkestratorOpplysninLinje({ opplysning, readOnly, formScope }: IProps) {
if (readOnly) {
return (
<div className={classNames(styles.orkestratorOpplysningsLinje, styles.bakgrunn)}>
<div>{hentOrkestratorBarnOpplysningLabel(opplysning.id)}</div>
<div>{formatterOrkestratorOpplysningVerdi(opplysning)}</div>
<div className={styles.alightRight}>
<OrkestratorTag kilde={opplysning.kilde} />
</div>
</div>
);
}
return (
<div className={classNames(styles.orkestratorOpplysningsLinje, styles.korrigering)}>
<div>
<OrkestratorOpplysning opplysning={opplysning} formScope={formScope} />
</div>
<div />
<div className={styles.alightRight}>
<OrkestratorTag kilde={opplysning.kilde} />
</div>
</div>
);
}