import React from 'react';
import PropTypes from 'prop-types';
import ReactBootstrapDropdown from 'react-bootstrap/lib/Dropdown';

export class Dropdown extends React.Component {
    static Menu = ReactBootstrapDropdown.Menu;
    static Toggle = ReactBootstrapDropdown.Toggle;

    static propTypes = {
        testAutomationId: PropTypes.string,
        children: PropTypes.node.isRequired
    };

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

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

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