import React from 'react';
import PropTypes from 'prop-types';
class PopupMenuItem extends React.Component {
render() {
const {itemId, value, onClick, selected, disabled} = this.props;
const additionalClasses = selected ? 'selected' : disabled ? 'disabled' : '';
return (
{
event.stopPropagation();
onClick && !disabled && onClick(itemId);
}}>
{value}
);
}
}
PopupMenuItem.propTypes = {
itemId: PropTypes.any,
value: PropTypes.any,
selected: PropTypes.bool,
onClick: PropTypes.func,
disabled: PropTypes.bool
};
PopupMenuItem.defaultProps = {
selected: false,
disabled: false
};
export default PopupMenuItem;