-
Notifications
You must be signed in to change notification settings - Fork 13
/
ResourceLabelVertical.jsx
61 lines (58 loc) · 1.8 KB
/
ResourceLabelVertical.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
59
60
61
import React from 'react';
import { includes } from 'lodash';
import {
ChevronRight as SeparatorIcon,
} from '@mui/icons-material';
const SEPARATOR = (<SeparatorIcon />)
const ResourceLabelVertical = props => {
const { resource } = props;
const isSourceChild = includes(['concept', 'mapping'], resource);
const parentTextStyles = {
width: '100%',
fontSize: '10px',
background: '#eee',
padding: '2px 5px',
textAlign: 'center',
borderRadius: '2px',
overflowX: 'auto',
}
const nameTextStyles = {
color: 'white',
padding: '0 5px',
borderRadius: '2px',
minHeight: '18px',
}
return (
<div className='no-side-padding col-md-12 flex-vertical-center'>
<div className='no-side-padding flex-vertical-center' style={{width: '5%'}}>
{props.icon}
</div>
<div style={isSourceChild ? {width: '90%', padding: '0 5px'} : {width: '95%', padding: '0 5px'}}>
<div className='col-md-12 flex-vertical-center' style={parentTextStyles}>
{
props.owner &&
<span>{props.owner}</span>
}
{
props.owner && props.parent &&
<span className='separator-small'>{SEPARATOR}</span>
}
{
props.parent &&
<span>{props.parent}</span>
}
{
(!props.owner && !props.parent && props.parentURL) &&
<span className=''>{props.parentURL}</span>
}
<span className='separator-small'>{SEPARATOR}</span>
<span style={{maxWidth: '100%', fontWeight: 'bold'}}>{props.id || props.name}</span>
</div>
<div style={nameTextStyles} className={'col-md-12 ' + resource + '-bg'}>
<span>{props.name}</span>
</div>
</div>
</div>
)
}
export default ResourceLabelVertical;