You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
509 B
29 lines
509 B
6 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
import SelectedMenuItem from './SelectedMenuItem';
|
||
|
|
||
|
function ViewMenuItem(props) {
|
||
|
const {
|
||
|
name,
|
||
|
selectedView,
|
||
|
...otherProps
|
||
|
} = props;
|
||
|
|
||
|
const isSelected = name === selectedView;
|
||
|
|
||
|
return (
|
||
|
<SelectedMenuItem
|
||
|
name={name}
|
||
|
isSelected={isSelected}
|
||
|
{...otherProps}
|
||
|
/>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
ViewMenuItem.propTypes = {
|
||
|
name: PropTypes.string,
|
||
|
selectedView: PropTypes.string.isRequired
|
||
|
};
|
||
|
|
||
|
export default ViewMenuItem;
|