-
Notifications
You must be signed in to change notification settings - Fork 12
/
ConceptContainerLabel.jsx
55 lines (50 loc) · 1.86 KB
/
ConceptContainerLabel.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
import React from 'react';
import { Link } from 'react-router-dom';
import {
Person as PersonIcon,
Home as HomeIcon,
List as ListIcon,
Loyalty as LoyaltyIcon,
AccountTreeRounded as TreeIcon,
} from '@mui/icons-material';
const SEPARATOR = '/'
const ConceptContainerLabel = props => {
const ownerType = (props.ownerType || props.owner_type || '').toLowerCase()
let icon = <LoyaltyIcon fontSize='small' />;
if(props.resource === 'source')
icon = <ListIcon fontSize='small' /> ;
let ownerIcon = <HomeIcon fontSize='small' />;
if(ownerType === 'users')
ownerIcon = <PersonIcon fontSize='small' />;
return (
<div className='col-sm-12 no-side-padding flex-vertical-center' style={{margin: '5px 0'}}>
<Link to={props.uri} className='no-anchor-styles flex-vertical-center'>
{
props.owner && props.ownerType &&
<React.Fragment>
<span className='resource-label resource-id orange' style={{borderRadius: '0.25em'}}>
<span style={{paddingTop: '5px'}}>{ownerIcon}</span>
<span>{props.owner}</span>
</span>
<span className='separator-small'>{SEPARATOR}</span>
</React.Fragment>
}
<span className='resource-label resource-id green' style={{borderRadius: '0.25em'}}>
<span style={{paddingTop: '5px'}}>{icon}</span>
<span>{props.id}</span>
</span>
{
props.version &&
<React.Fragment>
<span className='separator-small'>{SEPARATOR}</span>
<span className='resource-label resource-id green' style={{borderRadius: '0.25em'}}>
<span style={{paddingTop: '5px'}}><TreeIcon fontSize='small' /></span>
<span>{props.version}</span>
</span>
</React.Fragment>
}
</Link>
</div>
)
}
export default ConceptContainerLabel;