|
|
|
|
@ -3,7 +3,7 @@ import type { FC } from 'react'
|
|
|
|
|
import Modal from '@/app/components/base/modal'
|
|
|
|
|
import React, { useCallback, useState } from 'react'
|
|
|
|
|
import { InstallStep } from '../../types'
|
|
|
|
|
import type { Dependency, Plugin } from '../../types'
|
|
|
|
|
import type { Dependency, InstallStatusResponse, Plugin } from '../../types'
|
|
|
|
|
import Install from './steps/install'
|
|
|
|
|
import Installed from './steps/installed'
|
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
|
@ -31,7 +31,7 @@ const InstallBundle: FC<Props> = ({
|
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
const [step, setStep] = useState<InstallStep>(installType === InstallType.fromMarketplace ? InstallStep.readyToInstall : InstallStep.uploading)
|
|
|
|
|
const [installedPlugins, setInstalledPlugins] = useState<Plugin[]>([])
|
|
|
|
|
const [installStatus, setInstallStatus] = useState<{ success: boolean }[]>([])
|
|
|
|
|
const [installStatus, setInstallStatus] = useState<InstallStatusResponse[]>([])
|
|
|
|
|
const getTitle = useCallback(() => {
|
|
|
|
|
if (step === InstallStep.uploadFailed)
|
|
|
|
|
return t(`${i18nPrefix}.uploadFailed`)
|
|
|
|
|
@ -43,7 +43,7 @@ const InstallBundle: FC<Props> = ({
|
|
|
|
|
return t(`${i18nPrefix}.installPlugin`)
|
|
|
|
|
}, [step, t])
|
|
|
|
|
|
|
|
|
|
const handleInstalled = useCallback((plugins: Plugin[], installStatus: { success: boolean }[]) => {
|
|
|
|
|
const handleInstalled = useCallback((plugins: Plugin[], installStatus: InstallStatusResponse[]) => {
|
|
|
|
|
setInstallStatus(installStatus)
|
|
|
|
|
setInstalledPlugins(plugins)
|
|
|
|
|
setStep(InstallStep.installed)
|
|
|
|
|
|