"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_core_1 = require("@patternfly/react-core");
const react_1 = __importDefault(require("react"));
const Chatbot_1 = require("../Chatbot");
const react_icons_1 = require("@patternfly/react-icons");
const FileDropZone = (_a) => {
    var { children, className, infoText = 'Maximum file size is 25 MB', onFileDrop, displayMode = Chatbot_1.ChatbotDisplayMode.default } = _a, props = __rest(_a, ["children", "className", "infoText", "onFileDrop", "displayMode"]);
    const [showDropZone, setShowDropZone] = react_1.default.useState(false);
    const renderDropZone = () => (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(react_core_1.MultipleFileUploadMain, { titleIcon: react_1.default.createElement(react_icons_1.UploadIcon, null), titleText: "Drag and drop your file here", infoText: infoText, isUploadButtonHidden: true })));
    return (react_1.default.createElement(react_core_1.MultipleFileUpload, { dropzoneProps: Object.assign({ onDrop: () => setShowDropZone(false) }, props), onDragEnter: () => setShowDropZone(true), onDragLeave: () => setShowDropZone(false), onFileDrop: onFileDrop, className: `pf-chatbot__dropzone pf-chatbot__dropzone--${displayMode} pf-chatbot__dropzone--${showDropZone ? 'visible' : 'invisible'} ${className ? className : ''}` }, showDropZone ? renderDropZone() : children));
};
exports.default = FileDropZone;
