mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 13:57:11 -04:00
47 lines
721 B
JavaScript
47 lines
721 B
JavaScript
import PropTypes from 'prop-types';
|
|
import React, { Component } from 'react';
|
|
import MenuItem from './MenuItem';
|
|
|
|
class SearchMenuItem extends Component {
|
|
|
|
//
|
|
// Listeners
|
|
|
|
onPress = () => {
|
|
const {
|
|
name,
|
|
onPress
|
|
} = this.props;
|
|
|
|
onPress(name);
|
|
};
|
|
|
|
//
|
|
// Render
|
|
|
|
render() {
|
|
const {
|
|
children,
|
|
...otherProps
|
|
} = this.props;
|
|
|
|
return (
|
|
<MenuItem
|
|
{...otherProps}
|
|
onPress={this.onPress}
|
|
>
|
|
<div>
|
|
{children}
|
|
</div>
|
|
</MenuItem>
|
|
);
|
|
}
|
|
}
|
|
|
|
SearchMenuItem.propTypes = {
|
|
name: PropTypes.string,
|
|
children: PropTypes.node.isRequired,
|
|
onPress: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default SearchMenuItem;
|