-
Notifications
You must be signed in to change notification settings - Fork 12
/
ResourceLabel.jsx
43 lines (40 loc) · 1.46 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
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react';
import {
ChevronRight as SeparatorIcon,
} from '@mui/icons-material';
const SEPARATOR = (<SeparatorIcon />)
const ResourceLabel = props => {
const { noSeparator, searchable } = props;
return (
<div className='col-xs-12 no-side-padding flex-vertical-center' style={{flexWrap: 'wrap'}}>
<span className='resource-label ellipsis-text' style={{maxWidth: '100%'}}>
<span style={{paddingTop: '5px'}}>{props.icon}</span>
{
props.owner &&
<span className='ellipsis-text-3'>{props.owner}</span>
}
{
props.owner && props.parent &&
<span className='separator'>{SEPARATOR}</span>
}
{
props.parent &&
<span className='ellipsis-text-3'>{props.parent}</span>
}
{
(!props.owner && !props.parent && props.parentURL) &&
<span className='ellipsis-text-3'>{props.parentURL}</span>
}
{
!noSeparator &&
<span className='separator'>{SEPARATOR}</span>
}
<span className={'resource-name ellipsis-text-3' + searchable ? ' searchable' : ''} style={{maxWidth: '100%'}}>{props.id || props.name}</span>
</span>
<span className={'resource-label resource-id ' + (props.colorClass || '')} style={{maxWidth: '100%'}}>
<span className={'ellipsis-text' + searchable ? ' searchable' : ''}>{props.name}</span>
</span>
</div>
)
}
export default ResourceLabel;