-
Notifications
You must be signed in to change notification settings - Fork 12
/
CloneToSourceResultPreview.jsx
58 lines (56 loc) · 2.14 KB
/
CloneToSourceResultPreview.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
49
50
51
52
53
54
55
56
57
58
import React from 'react'
import {
CircularProgress, DialogContent,
Divider
} from '@mui/material'
import Concept from '../concepts/Concept'
import Mapping from '../mappings/Mapping'
import { filter, map, isEmpty } from 'lodash'
const CloneToSourceResultPreview = ({ concept, isLoading}) => {
const concepts = filter(concept.previewBundle?.entry, {type: 'Concept'})
const mappings = filter(concept.previewBundle?.entry, {type: 'Mapping'})
return (
<DialogContent>
<div className='col-xs-12 no-side-padding' style={{display: 'flex'}}>
{
isLoading ?
<div className='col-xs-12 flex-vertical-center' style={{justifyContent: 'center'}}>
<CircularProgress />
</div> :
<React.Fragment>
<div className='col-xs-6' style={{width: 'calc(50%-1px)'}}>
<h4 style={{margin: '10px 0'}}>{`Concepts (${concepts.length})`}</h4>
{
isEmpty(concepts) ?
<p>0 concepts</p> :
map(concepts, (_concept, index) => (
<React.Fragment key={index}>
<Concept {..._concept} />
<Divider style={{display: 'inline-block', width: '100%'}}/>
</React.Fragment>
))
}
</div>
<div className='col-xs-1 no-side-padding' style={{width: '2px'}}>
<Divider orientation='vertical' style={{}} />
</div>
<div className='col-xs-6' style={{width: 'calc(50%-1px)'}}>
<h4 style={{margin: '10px 0'}}>{`Mappings (${mappings.length})`}</h4>
{
isEmpty(mappings) ?
<p>0 mappings</p> :
map(mappings, (_mapping, index) => (
<React.Fragment key={index}>
<Mapping {..._mapping} />
<Divider style={{display: 'inline-block', width: '100%'}}/>
</React.Fragment>
))
}
</div>
</React.Fragment>
}
</div>
</DialogContent>
)
}
export default CloneToSourceResultPreview;