-
Notifications
You must be signed in to change notification settings - Fork 12
/
ConceptHierarchyRow.jsx
54 lines (51 loc) · 1.6 KB
/
ConceptHierarchyRow.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
import React from 'react';
import {
TableRow, TableCell, Chip
} from '@material-ui/core';
import { map } from 'lodash';
const ConceptHierarchyRow = ({ mapType, concepts, source }) => {
const onDefaultClick = (event, concept) => {
event.stopPropagation()
event.preventDefault()
window.location.hash = concept.url
}
return (
<React.Fragment>
{
mapType &&
<TableRow hover>
<TableCell align='left' rowSpan={concepts.length + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingTop: '7px'}}>
<Chip
size='small'
variant='outlined'
color='default'
label={mapType}
style={{border: 'none'}}
/>
</TableCell>
</TableRow>
}
{
map(concepts, concept => {
return (
<TableRow
hover key={concept.uuid} onClick={event => onDefaultClick(event, concept)} style={{cursor: 'pointer'}} className='underline-text'>
<TableCell align='left' className='ellipsis-text' style={{maxWidth: '200px'}}>
{concept.id}
</TableCell>
<TableCell align='left'>
{ concept.name }
</TableCell>
<TableCell align='left'>
{ `${source.owner} / ${source.id}` }
</TableCell>
<TableCell align='right' style={{width: '24px', paddingRight: '5px'}}>
</TableCell>
</TableRow>
)
})
}
</React.Fragment>
)
}
export default ConceptHierarchyRow;