1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00
Files
Radarr/frontend/src/Components/Menu/ViewMenuItem.js
T
Mark McDowall 36b055d372 Add typescript
(cherry picked from commit 910511dba03196f14bb238c8e15f060c12183c08)
2023-04-29 22:47:02 -05:00

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;