-
Notifications
You must be signed in to change notification settings - Fork 12
/
ResourceVersionLabel.jsx
64 lines (62 loc) · 1.9 KB
/
ResourceVersionLabel.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
62
63
64
import React from 'react';
import {
AccountTreeRounded as TreeIcon,
AspectRatio as ExpansionIcon
} from '@material-ui/icons';
import { Tooltip } from '@material-ui/core';
import ReleasedChip from './ReleasedChip';
import RetiredChip from './RetiredChip';
import ProcessingChip from './ProcessingChip';
import ExpansionChip from './ExpansionChip';
import { GREEN } from '../../common/constants';
const SEPARATOR = '/'
const ResourceVersionLabel = props => {
const gridClass = props.gridClass || 'col-sm-12'
return (
<div className={`${gridClass} no-side-padding`}>
<span className='resource-label'>
<span style={{paddingTop: '5px'}}>
<TreeIcon fontSize='small' style={{width: '14px'}} />
</span>
<span>{props.owner}</span>
<span>{SEPARATOR}</span>
<span>{props.short_code}</span>
<span>{SEPARATOR}</span>
<span className='resource-name'>[{props.version}]</span>
</span>
{
props.released &&
<span style={{marginLeft: '10px'}}>
<ReleasedChip size='small' />
</span>
}
{
props.retired &&
<span style={{marginLeft: '10px'}}>
<RetiredChip size='small' />
</span>
}
{
props.is_processing &&
<span style={{marginLeft: '10px'}}>
<ProcessingChip size='small' />
</span>
}
{
props.includeExpanded && props.autoexpand &&
<span style={{marginLeft: '10px'}}>
<ExpansionChip size='small' expanded />
</span>
}
{
props.includeExpansionIcon && props.autoexpand &&
<span style={{marginLeft: '10px', display: 'inline-flex', verticalAlign: 'middle'}}>
<Tooltip arrow title='Auto Expanded' placement='right'>
<ExpansionIcon style={{color: GREEN}}/>
</Tooltip>
</span>
}
</div>
)
}
export default ResourceVersionLabel;