@lysaab/lysa-pep 0.18.0 → 1.0.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +4 -0
- package/lib/Exports.d.ts +7 -8
- package/lib/Exports.js +7 -8
- package/lib/components/CountrySelect.d.ts +15 -22
- package/lib/components/CountrySelect.js +30 -21
- package/lib/components/PepAnswers.d.ts +8 -8
- package/lib/components/PepAnswers.js +131 -39
- package/lib/components/PepAnswers.scss +7 -7
- package/lib/model/Countries.d.ts +4 -4
- package/lib/model/Countries.js +1002 -1002
- package/lib/model/PepModel.d.ts +7 -7
- package/lib/model/PepModel.js +40 -40
- package/lib/model/PepTexts.d.ts +322 -380
- package/lib/model/PepTexts.js +467 -552
- package/lib/pages/IsPep/IsPepMessages.d.ts +32 -0
- package/lib/pages/IsPep/IsPepMessages.js +74 -0
- package/lib/pages/IsPep/IsPepPage.d.ts +14 -0
- package/lib/pages/IsPep/IsPepPage.js +39 -0
- package/lib/pages/PepContext.d.ts +80 -80
- package/lib/pages/PepContext.js +88 -88
- package/lib/pages/PepIsPepPage.d.ts +6 -15
- package/lib/pages/PepIsPepPage.js +57 -59
- package/lib/pages/PepRelationPage.d.ts +6 -6
- package/lib/pages/PepRelationPage.js +83 -79
- package/lib/pages/PepRolePage.d.ts +9 -10
- package/lib/pages/PepRolePage.js +127 -127
- package/lib/pages/PepStatusPage.d.ts +6 -6
- package/lib/pages/PepStatusPage.js +57 -58
- package/lib/pages/RelationPage/RelationMessages.d.ts +105 -0
- package/lib/pages/RelationPage/RelationMessages.js +282 -0
- package/lib/pages/RelationPage/RelationPage.d.ts +6 -0
- package/lib/pages/RelationPage/RelationPage.js +142 -0
- package/lib/pages/RolePage/RoleMessages.d.ts +185 -0
- package/lib/pages/RolePage/RoleMessages.js +381 -0
- package/lib/pages/RolePage/RolePage.d.ts +11 -0
- package/lib/pages/RolePage/RolePage.js +214 -0
- package/lib/pages/StatusPage/StatusMessages.d.ts +72 -0
- package/lib/pages/StatusPage/StatusMessages.js +74 -0
- package/lib/pages/StatusPage/StatusPage.d.ts +6 -0
- package/lib/pages/StatusPage/StatusPage.js +75 -0
- package/package.json +56 -53
- package/src/Exports.ts +12 -13
- package/src/components/CountrySelect.tsx +47 -43
- package/src/components/PepAnswers.scss +7 -7
- package/src/components/PepAnswers.tsx +252 -120
- package/src/demo/Done.tsx +16 -20
- package/src/demo/Pep.tsx +112 -106
- package/src/model/PepModel.ts +52 -52
- package/src/pages/IsPep/IsPepMessages.ts +75 -0
- package/src/pages/IsPep/IsPepPage.tsx +94 -0
- package/src/pages/PepContext.tsx +144 -144
- package/src/pages/RelationPage/RelationMessages.ts +287 -0
- package/src/pages/RelationPage/RelationPage.tsx +269 -0
- package/src/pages/RolePage/RoleMessages.ts +389 -0
- package/src/pages/RolePage/RolePage.tsx +342 -0
- package/src/pages/StatusPage/StatusMessages.ts +80 -0
- package/src/pages/StatusPage/StatusPage.tsx +172 -0
- package/src/model/PepTexts.ts +0 -607
- package/src/pages/PepIsPepPage.tsx +0 -107
- package/src/pages/PepRelationPage.tsx +0 -188
- package/src/pages/PepRolePage.tsx +0 -272
- package/src/pages/PepStatusPage.tsx +0 -157
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
import React, { useState, FunctionComponent } from "react";
|
|
2
|
-
import { Alternative, Select } from "@lysaab/ui-2";
|
|
3
|
-
import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
|
|
4
|
-
import { countries } from "../model/Countries";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
value: string;
|
|
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
|
-
|
|
43
|
-
}
|
|
1
|
+
import React, { useState, FunctionComponent } from "react";
|
|
2
|
+
import { Alternative, Select } from "@lysaab/ui-2";
|
|
3
|
+
import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
|
|
4
|
+
import { countries } from "../model/Countries";
|
|
5
|
+
import { defineMessages, useIntl } from "react-intl";
|
|
6
|
+
|
|
7
|
+
export interface Country {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Props extends ValidationProps {
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange?(value: Alternative<string>): void;
|
|
15
|
+
label: string;
|
|
16
|
+
omitCountries?: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const messages = defineMessages({
|
|
20
|
+
placeholder: {
|
|
21
|
+
id: 'component.select.country',
|
|
22
|
+
description: 'Select a country placeholder',
|
|
23
|
+
defaultMessage: 'Välj ett land'
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export const CountrySelect: FunctionComponent<Props> = ({
|
|
28
|
+
value,
|
|
29
|
+
omitCountries = [],
|
|
30
|
+
...props
|
|
31
|
+
}) => {
|
|
32
|
+
const intl = useIntl();
|
|
33
|
+
const [countryAlternatives] = useState(
|
|
34
|
+
countries
|
|
35
|
+
.filter(country => !omitCountries.includes(country.value))
|
|
36
|
+
.map(country => ({ text: country.label, value: country.value }))
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Select
|
|
41
|
+
alternatives={countryAlternatives}
|
|
42
|
+
placeholder={intl.formatMessage(messages.placeholder)}
|
|
43
|
+
value={countryAlternatives.find(country => country.value === value)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.static-input {
|
|
2
|
-
margin-bottom: 8px;
|
|
3
|
-
|
|
4
|
-
.label {
|
|
5
|
-
font-weight: bold;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.static-input {
|
|
2
|
+
margin-bottom: 8px;
|
|
3
|
+
|
|
4
|
+
.label {
|
|
5
|
+
font-weight: bold;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,120 +1,252 @@
|
|
|
1
|
-
import React, { FunctionComponent } from "react";
|
|
2
|
-
import "./PepAnswers.scss";
|
|
3
|
-
import { PepRequest } from "../model/PepModel";
|
|
4
|
-
import { countries } from "../model/Countries";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
1
|
+
import React, { FunctionComponent } from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import { PepRequest } from "../model/PepModel";
|
|
4
|
+
import { countries } from "../model/Countries";
|
|
5
|
+
import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
|
|
6
|
+
import { EntityType, PepType } from "../pages/PepContext";
|
|
7
|
+
import { useIntl, defineMessages, FormattedMessage } from "react-intl";
|
|
8
|
+
import { messages as isPepMessages } from "../pages/IsPep/IsPepMessages";
|
|
9
|
+
import {
|
|
10
|
+
relationMessages,
|
|
11
|
+
businessRelationMessages
|
|
12
|
+
} from "../pages/RelationPage/RelationMessages";
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
answer: PepRequest;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const messages = defineMessages({
|
|
19
|
+
whoIsPepLabel: {
|
|
20
|
+
id: "pep.anwers.who.label",
|
|
21
|
+
description: "Who is pep label",
|
|
22
|
+
defaultMessage: "Vem är pep"
|
|
23
|
+
},
|
|
24
|
+
relationLabel: {
|
|
25
|
+
id: "pep.anwers.relation.label",
|
|
26
|
+
description: "Relation label",
|
|
27
|
+
defaultMessage: "Relation"
|
|
28
|
+
},
|
|
29
|
+
businessRelationLabel: {
|
|
30
|
+
id: "pep.anwers.businessRelation.label",
|
|
31
|
+
description: "Business relation label",
|
|
32
|
+
defaultMessage: "Vem är pep"
|
|
33
|
+
},
|
|
34
|
+
nameOfPepLabel: {
|
|
35
|
+
id: "pep.anwers.nameOfPep.label",
|
|
36
|
+
description: "Name of pep label",
|
|
37
|
+
defaultMessage: "Namn på personen"
|
|
38
|
+
},
|
|
39
|
+
birthdayOfPEPLabel: {
|
|
40
|
+
id: "pep.anwers.birthdayOfPEP.label",
|
|
41
|
+
description: "Birthday of pep label",
|
|
42
|
+
defaultMessage: "Födelsedag för personen"
|
|
43
|
+
},
|
|
44
|
+
statusLabel: {
|
|
45
|
+
id: "pep.anwers.status.label",
|
|
46
|
+
description: "Status label",
|
|
47
|
+
defaultMessage: "Status"
|
|
48
|
+
},
|
|
49
|
+
statusEndedValue: {
|
|
50
|
+
id: "pep.anwers.statusEnded.value",
|
|
51
|
+
description: "Status ended value",
|
|
52
|
+
defaultMessage: "Avslutad"
|
|
53
|
+
},
|
|
54
|
+
statusOngoingValue: {
|
|
55
|
+
id: "pep.anwers.statusOngoing.value",
|
|
56
|
+
description: "Status ongoing value",
|
|
57
|
+
defaultMessage: "Pågående"
|
|
58
|
+
},
|
|
59
|
+
endedLabel: {
|
|
60
|
+
id: "pep.anwers.endedStatus.label",
|
|
61
|
+
description: "Ended label",
|
|
62
|
+
defaultMessage: "Avslutades"
|
|
63
|
+
},
|
|
64
|
+
roleLabel: {
|
|
65
|
+
id: "pep.anwers.role.label",
|
|
66
|
+
description: "Role label",
|
|
67
|
+
defaultMessage: "Roll"
|
|
68
|
+
},
|
|
69
|
+
countryLabel: {
|
|
70
|
+
id: "pep.anwers.country.label",
|
|
71
|
+
description: "Country label",
|
|
72
|
+
defaultMessage: "Land"
|
|
73
|
+
},
|
|
74
|
+
ambassadorCountryLabel: {
|
|
75
|
+
id: "pep.anwers.ambassadorCountry.label",
|
|
76
|
+
description: "Ambassador country label",
|
|
77
|
+
defaultMessage: "Ambassadörsland"
|
|
78
|
+
},
|
|
79
|
+
governmentCompanyNameLabel: {
|
|
80
|
+
id: "pep.anwers.governmentCompanyName.label",
|
|
81
|
+
description: "Government company name label",
|
|
82
|
+
defaultMessage: "Företags namn"
|
|
83
|
+
},
|
|
84
|
+
governmentCompanyRoleLabel: {
|
|
85
|
+
id: "pep.anwers.governmentCompanyRole.label",
|
|
86
|
+
description: "Government company role label",
|
|
87
|
+
defaultMessage: "Roll på företaget"
|
|
88
|
+
},
|
|
89
|
+
internationalOrganisationNameLabel: {
|
|
90
|
+
id: "pep.anwers.companyName.label",
|
|
91
|
+
description: "International organisation name label",
|
|
92
|
+
defaultMessage: "Organisationens namn"
|
|
93
|
+
},
|
|
94
|
+
internationalOrganisationRoleLabel: {
|
|
95
|
+
id: "pep.anwers.companyRole.label",
|
|
96
|
+
description: "International organisation role label",
|
|
97
|
+
defaultMessage: "Roll i organisationen"
|
|
98
|
+
},
|
|
99
|
+
militaryGradeLabel: {
|
|
100
|
+
id: "pep.anwers.militaryRank.label",
|
|
101
|
+
description: "Military rank label",
|
|
102
|
+
defaultMessage: "Roll i organisationen"
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export const PepAnswers: FunctionComponent<Props> = ({ answer }) => {
|
|
107
|
+
const intl = useIntl();
|
|
108
|
+
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
109
|
+
return (
|
|
110
|
+
<div>
|
|
111
|
+
<p>
|
|
112
|
+
<FormattedMessage
|
|
113
|
+
id="pep.anwers.notpep"
|
|
114
|
+
description="Not pep"
|
|
115
|
+
defaultMessage="Personen är inte PEP"
|
|
116
|
+
/>
|
|
117
|
+
</p>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const country = countries.find(country => country.value === answer.country);
|
|
123
|
+
const role = getRoleAlts(intl).find(alt => alt.value === answer.role);
|
|
124
|
+
const militaryRank = getMilitaryAlts(intl).find(
|
|
125
|
+
alt => alt.value === answer.militaryRank
|
|
126
|
+
);
|
|
127
|
+
return (
|
|
128
|
+
<div>
|
|
129
|
+
{answer.type && (
|
|
130
|
+
<StaticInput
|
|
131
|
+
label={intl.formatMessage(messages.whoIsPepLabel)}
|
|
132
|
+
value={intl.formatMessage(isPepMessages[answer.type], {
|
|
133
|
+
entityType: EntityType.PERSON
|
|
134
|
+
})}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
{answer.relationToPEP && (
|
|
138
|
+
<StaticInput
|
|
139
|
+
label={intl.formatMessage(messages.relationLabel)}
|
|
140
|
+
value={intl.formatMessage(relationMessages[answer.relationToPEP])}
|
|
141
|
+
/>
|
|
142
|
+
)}
|
|
143
|
+
{answer.businessRelation && (
|
|
144
|
+
<StaticInput
|
|
145
|
+
label={intl.formatMessage(messages.businessRelationLabel)}
|
|
146
|
+
value={intl.formatMessage(
|
|
147
|
+
businessRelationMessages[answer.businessRelation]
|
|
148
|
+
)}
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
{answer.nameOfPEP && (
|
|
152
|
+
<StaticInput
|
|
153
|
+
label={intl.formatMessage(messages.nameOfPepLabel)}
|
|
154
|
+
value={answer.nameOfPEP}
|
|
155
|
+
/>
|
|
156
|
+
)}
|
|
157
|
+
{answer.birthdayOfPEP && (
|
|
158
|
+
<StaticInput
|
|
159
|
+
label={intl.formatMessage(messages.birthdayOfPEPLabel)}
|
|
160
|
+
value={answer.birthdayOfPEP}
|
|
161
|
+
/>
|
|
162
|
+
)}
|
|
163
|
+
{answer.ended ? (
|
|
164
|
+
<React.Fragment>
|
|
165
|
+
<StaticInput
|
|
166
|
+
label={intl.formatMessage(messages.statusLabel)}
|
|
167
|
+
value={intl.formatMessage(messages.statusEndedValue)}
|
|
168
|
+
/>
|
|
169
|
+
<StaticInput
|
|
170
|
+
label={intl.formatMessage(messages.endedLabel)}
|
|
171
|
+
value={answer.ended}
|
|
172
|
+
/>
|
|
173
|
+
</React.Fragment>
|
|
174
|
+
) : (
|
|
175
|
+
<StaticInput
|
|
176
|
+
label={intl.formatMessage(messages.statusLabel)}
|
|
177
|
+
value={intl.formatMessage(messages.statusOngoingValue)}
|
|
178
|
+
/>
|
|
179
|
+
)}
|
|
180
|
+
{answer.country && (
|
|
181
|
+
<StaticInput
|
|
182
|
+
label={intl.formatMessage(messages.countryLabel)}
|
|
183
|
+
value={country ? country.label : answer.country}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
{role && (
|
|
187
|
+
<StaticInput
|
|
188
|
+
label={intl.formatMessage(messages.roleLabel)}
|
|
189
|
+
value={role.text}
|
|
190
|
+
/>
|
|
191
|
+
)}
|
|
192
|
+
{answer.ambassadorCountry && (
|
|
193
|
+
<StaticInput
|
|
194
|
+
label={intl.formatMessage(messages.ambassadorCountryLabel)}
|
|
195
|
+
value={
|
|
196
|
+
countries.find(
|
|
197
|
+
country => country.value === answer.ambassadorCountry
|
|
198
|
+
)?.label || answer.ambassadorCountry
|
|
199
|
+
}
|
|
200
|
+
/>
|
|
201
|
+
)}
|
|
202
|
+
{answer.governmentCompany && (
|
|
203
|
+
<StaticInput
|
|
204
|
+
label={intl.formatMessage(messages.governmentCompanyNameLabel)}
|
|
205
|
+
value={answer.governmentCompany}
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
208
|
+
{answer.governmentCompanyRole && (
|
|
209
|
+
<StaticInput
|
|
210
|
+
label={intl.formatMessage(messages.governmentCompanyRoleLabel)}
|
|
211
|
+
value={answer.governmentCompanyRole}
|
|
212
|
+
/>
|
|
213
|
+
)}
|
|
214
|
+
{answer.internationalOrganisation && (
|
|
215
|
+
<StaticInput
|
|
216
|
+
label={intl.formatMessage(
|
|
217
|
+
messages.internationalOrganisationNameLabel
|
|
218
|
+
)}
|
|
219
|
+
value={answer.internationalOrganisation}
|
|
220
|
+
/>
|
|
221
|
+
)}
|
|
222
|
+
{answer.internationalOrganisationRole && (
|
|
223
|
+
<StaticInput
|
|
224
|
+
label={intl.formatMessage(
|
|
225
|
+
messages.internationalOrganisationRoleLabel
|
|
226
|
+
)}
|
|
227
|
+
value={answer.internationalOrganisationRole}
|
|
228
|
+
/>
|
|
229
|
+
)}
|
|
230
|
+
{militaryRank && (
|
|
231
|
+
<StaticInput
|
|
232
|
+
label={intl.formatMessage(messages.militaryGradeLabel)}
|
|
233
|
+
value={militaryRank.value}
|
|
234
|
+
/>
|
|
235
|
+
)}
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
interface StaticInputProps {
|
|
241
|
+
label: string;
|
|
242
|
+
value: string | React.ReactNode;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const StaticInput: FunctionComponent<StaticInputProps> = ({ label, value }) => {
|
|
246
|
+
return (
|
|
247
|
+
<div className="static-input">
|
|
248
|
+
<div className="label">{label}</div>
|
|
249
|
+
<div className="value">{value}</div>
|
|
250
|
+
</div>
|
|
251
|
+
);
|
|
252
|
+
};
|
package/src/demo/Done.tsx
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { PepContext } from "../pages/PepContext";
|
|
3
|
-
import { stateToRequest } from "../model/PepModel";
|
|
4
|
-
import { PepAnswers } from "../components/PepAnswers";
|
|
5
|
-
|
|
6
|
-
export function Done() {
|
|
7
|
-
const pepContext = useContext(PepContext);
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
<h2>Taco hej!</h2>
|
|
11
|
-
<p>Leverpastej!</p>
|
|
12
|
-
<PepAnswers
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { PepContext } from "../pages/PepContext";
|
|
3
|
+
import { stateToRequest } from "../model/PepModel";
|
|
4
|
+
import { PepAnswers } from "../components/PepAnswers";
|
|
5
|
+
|
|
6
|
+
export function Done() {
|
|
7
|
+
const pepContext = useContext(PepContext);
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
<h2>Taco hej!</h2>
|
|
11
|
+
<p>Leverpastej!</p>
|
|
12
|
+
<PepAnswers answer={stateToRequest(pepContext.state)} />
|
|
13
|
+
<pre>{JSON.stringify(stateToRequest(pepContext.state), null, 2)}</pre>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|