import React, { useState } from 'react';
import classNames from 'classnames';
var DraggerCover = function (props) {
    var _a;
    var onFile = props.onFile, disabled = props.disabled, prefixCls = props.prefixCls, children = props.children;
    var _b = useState(false), dragOver = _b[0], setDragOver = _b[1];
    var cls = classNames(prefixCls + "__dragger-cover", (_a = {},
        _a[prefixCls + "__dragger-cover_dragover"] = dragOver,
        _a[prefixCls + "__dragger-cover_disabled"] = disabled,
        _a));
    var handleDragOver = function (e, isOver) {
        e.preventDefault();
        if (!disabled) {
            setDragOver(isOver);
        }
    };
    var handleDrop = function (e) {
        e.preventDefault();
        if (!disabled) {
            setDragOver(false);
            onFile(e.dataTransfer.files);
        }
    };
    return (React.createElement("div", { className: cls, onDragOver: function (e) { return handleDragOver(e, true); }, onDragLeave: function (e) { return handleDragOver(e, false); }, onDrop: handleDrop }, children));
};
DraggerCover.displayName = 'DraggerCover';
export default DraggerCover;
//# sourceMappingURL=dragger-cover.js.map