mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -04:00
36b055d372
(cherry picked from commit 910511dba03196f14bb238c8e15f060c12183c08)
31 lines
630 B
JavaScript
31 lines
630 B
JavaScript
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,
|
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
|
|
onPress: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default ViewMenuItem;
|