'use strict';

import React from 'react';
import {FormGroup} from './FormGroup';
import {FileUploadControl} from './FileUploadControl';

export class FileUpload extends FormGroup<any> {
    static propTypes: any = {
        ...FormGroup.propTypes
    };

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

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