import React from 'react';
import classnames from 'classnames';
import { identity } from 'ramda';
import CircularProgress from '@mui/material/CircularProgress';
import CloudDownloadIcon from '@mui/icons-material/CloudDownload';
import DoneIcon from '@mui/icons-material/Done';
import { SmallIconButtonWithTooltip } from '../SmallIconButton';
import { ImportModes } from '../types';
import { useStyles } from './styles';
export 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 ? identity : _d, _e = _a.mode, mode = _e === void 0 ? ImportModes.Init : _e;
    var styles = useStyles();
    var renderCurrentMode = function () {
        switch (mode) {
            case ImportModes.Init: {
                return (React.createElement(SmallIconButtonWithTooltip, { className: classes.button, size: 'M', tooltipTitle: tooltip, icon: CloudDownloadIcon, onClick: onClick }));
            }
            case ImportModes.Progress:
                return React.createElement(CircularProgress, { className: classes.spinner, size: 24 });
            case ImportModes.Success:
                return React.createElement(DoneIcon, { className: classnames(styles.check, classes.check) });
            default:
                return null;
        }
    };
    return React.createElement("div", { className: classnames(styles.root, classes.root) }, renderCurrentMode());
};
