import React from 'react';
import PropTypes from 'prop-types';
import ReactBootstrapDropdownButton from 'react-bootstrap/lib/DropdownButton';

export class DropdownButton 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 (
            <ReactBootstrapDropdownButton data-test-automation-id={testAutomationId} {...props}>
                {children}
            </ReactBootstrapDropdownButton>
        );
    }
}
