-
Notifications
You must be signed in to change notification settings - Fork 12
/
ResourceLabel.jsx
31 lines (29 loc) · 1.05 KB
/
ResourceLabel.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
import React from 'react';
const SEPARATOR = '/'
const ResourceLabel = props => {
return (
<div className='col-sm-12 no-side-padding'>
<span className='resource-label ellipsis-text' style={{maxWidth: '100%'}}>
<span style={{paddingTop: '5px'}}>{props.icon}</span>
{
(props.owner && props.parent) ?
<React.Fragment>
<span className='ellipsis-text-3'>{props.owner}</span>
<span>{SEPARATOR}</span>
<span className='ellipsis-text-3'>{props.parent}</span>
</React.Fragment> :
(
props.parentURL &&
<span className='ellipsis-text-3'>{props.parentURL}</span>
)
}
<span>{SEPARATOR}</span>
<span className='resource-name ellipsis-text-3' style={{maxWidth: '100%'}}>{props.id || props.name}</span>
</span>
<span className='resource-label resource-id' style={{maxWidth: '100%'}}>
<span className='ellipsis-text'>{props.name || 'None'}</span>
</span>
</div>
)
}
export default ResourceLabel;