"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportButton = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
var ramda_1 = require("ramda");
var CircularProgress_1 = __importDefault(require("@mui/material/CircularProgress"));
var CloudDownload_1 = __importDefault(require("@mui/icons-material/CloudDownload"));
var Done_1 = __importDefault(require("@mui/icons-material/Done"));
var SmallIconButton_1 = require("../SmallIconButton");
var types_1 = require("../types");
var styles_1 = require("./styles");
var ImportButton = function (_a) {
    var _b = _a.classes, classes = _b === void 0 ? {} : _b, _c = _a.tooltip, tooltip = _c === void 0 ? '' : _c, _d = _a.onClick, onClick = _d === void 0 ? ramda_1.identity : _d, _e = _a.mode, mode = _e === void 0 ? types_1.ImportModes.Init : _e;
    var styles = (0, styles_1.useStyles)();
    var renderCurrentMode = function () {
        switch (mode) {
            case types_1.ImportModes.Init: {
                return (react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { className: classes.button, size: 'M', tooltipTitle: tooltip, icon: CloudDownload_1.default, onClick: onClick }));
            }
            case types_1.ImportModes.Progress:
                return react_1.default.createElement(CircularProgress_1.default, { className: classes.spinner, size: 24 });
            case types_1.ImportModes.Success:
                return react_1.default.createElement(Done_1.default, { className: (0, classnames_1.default)(styles.check, classes.check) });
            default:
                return null;
        }
    };
    return react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, classes.root) }, renderCurrentMode());
};
exports.ImportButton = ImportButton;
