import React from 'react';
import PropTypes from 'prop-types';
import {DropdownButton as ReactBootstrapDropdownButton} from 'react-bootstrap';

export class DropdownButton extends React.Component<any> {
    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 as any}>
                {children}
            </ReactBootstrapDropdownButton>
        );
    }
}
