Add collaboration feature
[sdc.git] / openecomp-ui / src / sdc-app / onboarding / licenseModel / overview / summary / ListButtons.jsx
1 /*!
2  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13  * or implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  */
16 import React from 'react';
17 import PropTypes from 'prop-types';
18 import {selectedButton} from '../LicenseModelOverviewConstants.js';
19 import Tabs from 'sdc-ui/lib/react/Tabs.js';
20 import Tab from 'sdc-ui/lib/react/Tab.js';
21 import i18n from 'nfvo-utils/i18n/i18n.js';
22
23 function ListButtons ({onTabSelect, selectedTab, hasOrphans, hasLicensing}) {
24         // no data, no tabs
25         if (!hasLicensing && !hasOrphans) {
26                 return null;
27         }
28         return (
29                 <Tabs 
30                         onTabClick={(tabId) => onTabSelect(tabId)}
31                         activeTab={selectedTab}
32                         className='overview-buttons-section'
33                         type='header' >
34                         <Tab
35                                 tabId={selectedButton.VLM_LIST_VIEW}
36                                 title={i18n('Connections List')}
37                                 data-test-id='vlm-overview-vlmlist-tab' />
38                         <Tab
39                                 tabId={selectedButton.NOT_IN_USE}
40                                 title={i18n('Orphans List')}
41                                 data-test-id='vlm-overview-orphans-tab' />
42                 </Tabs>
43         );
44 }
45
46 ListButtons.propTypes = {
47         onTabSelect: PropTypes.func,
48         selectedInUse: PropTypes.bool
49 };
50
51 export default ListButtons;