1
|
|
|
import React, { FunctionComponent } from "react"; |
2
|
|
|
import { useIntl } from "react-intl"; |
3
|
|
|
import detailsMessages from "./detailsMessages"; |
4
|
|
|
import { getLocale } from "../../../helpers/localize"; |
5
|
|
|
import { readableDate } from "../../../helpers/dates"; |
6
|
|
|
import { ExperienceWork } from "../../../models/types"; |
7
|
|
|
|
8
|
|
|
const ExperienceWorkDetails: FunctionComponent<{ |
9
|
|
|
experience: ExperienceWork; |
10
|
|
|
}> = ({ experience }) => { |
11
|
|
|
const intl = useIntl(); |
12
|
|
|
const locale = getLocale(intl.locale); |
13
|
|
|
const { title, organization, group } = experience; |
14
|
|
|
const startDate = experience.start_date; |
15
|
|
|
const endDate = experience.start_date; |
16
|
|
|
const isActive = experience.is_active; |
17
|
|
|
const notApplicable = ( |
18
|
|
|
<p data-h2-font-color="b(gray-1)"> |
19
|
|
|
{intl.formatMessage(detailsMessages.notApplicable)} |
20
|
|
|
</p> |
21
|
|
|
); |
22
|
|
|
return ( |
23
|
|
|
<div data-h2-grid="b(middle, expanded, flush, 1)"> |
24
|
|
|
<div data-h2-grid-item="b(1of2) m(1of3)"> |
25
|
|
|
<div data-h2-grid-content> |
26
|
|
|
<p data-h2-font-weight="b(600)"> |
27
|
|
|
{intl.formatMessage(detailsMessages.experienceTypeLabel)} |
28
|
|
|
</p> |
29
|
|
|
<p> |
30
|
|
|
<i |
31
|
|
|
className="fas fa-briefcase" |
32
|
|
|
data-h2-font-color="b(theme-1)" |
33
|
|
|
data-h2-margin="b(right, .25)" |
34
|
|
|
/> |
35
|
|
|
{intl.formatMessage(detailsMessages.workType)} |
36
|
|
|
</p> |
37
|
|
|
</div> |
38
|
|
|
</div> |
39
|
|
|
<div data-h2-grid-item="b(1of2) m(1of3)"> |
40
|
|
|
<div data-h2-grid-content> |
41
|
|
|
<p data-h2-font-weight="b(600)"> |
42
|
|
|
{intl.formatMessage(detailsMessages.workRoleLabel)} |
43
|
|
|
</p> |
44
|
|
|
{title ? <p>{title}</p> : notApplicable} |
45
|
|
|
</div> |
46
|
|
|
</div> |
47
|
|
|
<div data-h2-grid-item="b(1of2) m(1of3)"> |
48
|
|
|
<div data-h2-grid-content> |
49
|
|
|
<p data-h2-font-weight="b(600)"> |
50
|
|
|
{intl.formatMessage(detailsMessages.workOrganizationLabel)} |
51
|
|
|
</p> |
52
|
|
|
{organization ? <p>{organization}</p> : notApplicable} |
53
|
|
|
</div> |
54
|
|
|
</div> |
55
|
|
|
<div data-h2-grid-item="b(1of2) m(1of3)"> |
56
|
|
|
<div data-h2-grid-content> |
57
|
|
|
<p data-h2-font-weight="b(600)"> |
58
|
|
|
{intl.formatMessage(detailsMessages.workTeamLabel)} |
59
|
|
|
</p> |
60
|
|
|
{group ? <p>{group}</p> : notApplicable} |
61
|
|
|
</div> |
62
|
|
|
</div> |
63
|
|
|
<div data-h2-grid-item="b(1of2) m(1of3)"> |
64
|
|
|
<div data-h2-grid-content> |
65
|
|
|
<p data-h2-font-weight="b(600)"> |
66
|
|
|
{intl.formatMessage(detailsMessages.startDateLabel)} |
67
|
|
|
</p> |
68
|
|
|
{startDate ? <p>{readableDate(locale, startDate)}</p> : notApplicable} |
69
|
|
|
</div> |
70
|
|
|
</div> |
71
|
|
|
<div data-h2-grid-item="b(1of2) m(1of3)"> |
72
|
|
|
<div data-h2-grid-content> |
73
|
|
|
<p data-h2-font-weight="b(600)"> |
74
|
|
|
{intl.formatMessage(detailsMessages.endDateLabel)} |
75
|
|
|
</p> |
76
|
|
|
{isActive && <p>{intl.formatMessage(detailsMessages.ongoing)}</p>} |
77
|
|
|
{!isActive && endDate ? ( |
78
|
|
|
<p>{readableDate(locale, endDate)}</p> |
79
|
|
|
) : ( |
80
|
|
|
notApplicable |
81
|
|
|
)} |
82
|
|
|
</div> |
83
|
|
|
</div> |
84
|
|
|
</div> |
85
|
|
|
); |
86
|
|
|
}; |
87
|
|
|
|
88
|
|
|
export default ExperienceWorkDetails; |
89
|
|
|
|