import React from 'react';
import PropTypes from 'prop-types';
import ReactBootstrapCol from 'react-bootstrap/lib/Col';

type ColProps = ReactBootstrapCol.ColProps & {
    testAutomationId?: string;
    children?: React.ReactNode;
} & Partial<ColDefaultProps>;

type ColDefaultProps = {};

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

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

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

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