-
Notifications
You must be signed in to change notification settings - Fork 12
/
ConceptHomeDetails.jsx
48 lines (45 loc) · 1.53 KB
/
ConceptHomeDetails.jsx
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
43
44
45
46
47
48
import React from 'react';
import { get } from 'lodash';
import HomeMappings from './HomeMappings';
import ConceptCollections from './ConceptCollections';
import CustomAttributesAccordian from '../common/CustomAttributesAccordian';
import HomeLocales from './HomeLocales';
const ACCORDIAN_HEADING_STYLES = {
fontWeight: 'bold',
}
const ACCORDIAN_DETAILS_STYLES = {
maxHeight: '300px', overflow: 'auto', display: 'inline-block', width: '100%', padding: '0'
}
const ConceptHomeDetails = ({ concept, isLoadingMappings, isLoadingCollections, source }) => {
const names = get(concept, 'names', [])
const descriptions = get(concept, 'descriptions', [])
return (
<React.Fragment>
<div className='col-md-6 no-left-padding'>
<HomeLocales
concept={concept}
locales={names}
source={source}
label='Names & Synonyms'
/>
<HomeLocales
concept={concept}
locales={descriptions}
source={source}
label='Descriptions'
isDescription
/>
<CustomAttributesAccordian
attributes={concept.extras || {}}
headingStyles={ACCORDIAN_HEADING_STYLES}
detailStyles={ACCORDIAN_DETAILS_STYLES}
/>
</div>
<div className='col-md-6 no-right-padding'>
<HomeMappings concept={concept} isLoadingMappings={isLoadingMappings} />
<ConceptCollections concept={concept} isLoadingCollections={isLoadingCollections} />
</div>
</React.Fragment>
);
}
export default ConceptHomeDetails;