import React from 'react';
import PropTypes from 'prop-types';
import ReactBootstrapMenuItem from 'react-bootstrap/lib/MenuItem';

export class MenuItem extends React.Component {
    static propTypes = {
        testAutomationId: PropTypes.string,
        children: PropTypes.node.isRequired
    };

    static defaultProps = {
        testAutomationId: null,
        children: null
    };

    render() {
        let {children, testAutomationId, ...props} = this.props;

        return (
            <ReactBootstrapMenuItem data-test-automation-id={testAutomationId} {...props}>
                {children}
            </ReactBootstrapMenuItem>
        );
    }
}
