Migrate sdc-sdc-workflow-designer docs
[sdc/sdc-workflow-designer.git] / workflow-designer-ui / src / main / frontend / src / shared / navigationSideBar / NavigationMenuItem.jsx
1 /*!
2  * Copyright © 2016-2018 European Support Limited
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
17 import React from 'react';
18 import PropTypes from 'prop-types';
19 import classnames from 'classnames';
20 import NavigationLink from './NavigationLink';
21
22 const NavigationMenuItem = ({ onNavigationItemClick, item, activeItemId }) => {
23     return (
24         <div
25             className={classnames('navigation-group-item', {
26                 'selected-item': item.id === activeItemId
27             })}
28             key={'item_' + item.id}>
29             <NavigationLink
30                 item={item}
31                 activeItemId={activeItemId}
32                 onClick={onNavigationItemClick}
33             />
34         </div>
35     );
36 };
37
38 NavigationMenuItem.propTypes = {
39     onNavigationItemClick: PropTypes.func,
40     item: PropTypes.object,
41     activeItemId: PropTypes.string
42 };
43
44 export default NavigationMenuItem;