2 * Copyright © 2016-2018 European Support Limited
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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 or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 import React from 'react';
17 import PropTypes from 'prop-types';
18 import i18n from 'nfvo-utils/i18n/i18n.js';
19 import { migrationStatusMapper } from './OnboardingCatalogConstants.js';
21 const VspOverlayItem = ({ vsp, onClick }) => {
22 const handleClick = () => onClick(vsp);
24 <div key={vsp.id} className="vsp-overlay-detail" onClick={handleClick}>
30 VspOverlayItem.propTypes = {
31 vsp: PropTypes.object,
32 onClick: PropTypes.func
35 const VSPOverlay = ({ VSPList, onSelectVSP, onSeeMore, onMigrate }) => {
36 const handleSelect = vsp => {
39 vsp.isOldVersion === migrationStatusMapper.OLD_VERSION
50 className="vsp-overlay-wrapper"
55 <div className="vsp-overlay-arrow" />
56 <div className="vsp-overlay">
57 <div className="vsp-overlay-title">
58 {i18n('Recently Edited')}
60 <div className="vsp-overlay-list">
61 {VSPList.slice(0, 5).map(vsp => (
64 onClick={handleSelect}
69 {VSPList.length > 5 && (
70 <div className="vsp-overlay-see-more" onClick={onSeeMore}>
79 VSPOverlay.propTypes = {
80 VSPList: PropTypes.array,
81 onSelectVSP: PropTypes.func
84 export default VSPOverlay;