'use strict';
import React from 'react';
import {FormGroup} from './FormGroup';
import {DatePickerControl} from './DatePickerControl';

export class DatePicker extends FormGroup {
    static propTypes = {
        ...FormGroup.propTypes
    };

    static defaultProps = {
        ...FormGroup.defaultProps,
        testAutomationId: 'datePicker'
    };

    renderInput(hasError) {
        let ariaDescProps = this.getAriaDescProps(hasError);
        return (
            <DatePickerControl
                {...this.getSafeProps(this.props)}
                ref="control"
                hasFormGroupContainer
                {...ariaDescProps}
            />
        );
    }
}
