import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
import * as __WEBPACK_EXTERNAL_MODULE__style_mjs__ from "../../style.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__form_PluginNpmForm_mjs__ from "../form/PluginNpmForm.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__form_PluginUploadForm_mjs__ from "../form/PluginUploadForm.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__form_PluginUrlForm_mjs__ from "../form/PluginUrlForm.mjs";
const PluginUpgradeModal = (param)=>{
    let { onClose, isShow, pluginData } = param;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
    const { theme } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)();
    const [type, setType] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)('npm');
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.Modal, {
        onCancel: ()=>onClose(),
        footer: null,
        destroyOnClose: true,
        title: t('Update plugin'),
        width: 580,
        open: isShow,
        children: [
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                style: {
                    marginTop: theme.marginLG,
                    marginBottom: theme.marginLG
                },
                children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.Radio.Group, {
                    optionType: "button",
                    defaultValue: type,
                    onChange: (e)=>setType(e.target.value),
                    children: [
                        /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Radio, {
                            value: "npm",
                            children: t('Npm package')
                        }),
                        /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Radio, {
                            value: "upload",
                            children: t('Upload plugin')
                        }),
                        /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Radio, {
                            value: "url",
                            children: t('Compressed file url')
                        })
                    ]
                })
            }),
            'npm' === type && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__form_PluginNpmForm_mjs__.PluginNpmForm, {
                isUpgrade: true,
                onClose: onClose,
                pluginData: pluginData
            }),
            'upload' === type && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__form_PluginUploadForm_mjs__.PluginUploadForm, {
                isUpgrade: true,
                onClose: onClose,
                pluginData: pluginData
            }),
            'url' === type && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__form_PluginUrlForm_mjs__.PluginUrlForm, {
                isUpgrade: true,
                onClose: onClose,
                pluginData: pluginData
            })
        ]
    });
};
export { PluginUpgradeModal };
