import { useCallback, useState, } from 'react' import { useTranslation } from 'react-i18next' import { useStore } from './store' import ReadyToInstall from '@/app/components/plugins/install-plugin/install-bundle/ready-to-install' import { InstallStep } from '@/app/components/plugins/types' const i18nPrefix = 'plugin.installModal' const PluginDependency = () => { const dependencies = useStore(s => s.dependencies) const [step, setStep] = useState(InstallStep.readyToInstall) const { t } = useTranslation() const getTitle = useCallback(() => { if (step === InstallStep.uploadFailed) return t(`${i18nPrefix}.uploadFailed`) if (step === InstallStep.installed) return t(`${i18nPrefix}.installComplete`) return t(`${i18nPrefix}.installPlugin`) }, [step, t]) if (!dependencies.length) return null return (
{getTitle()}
{}} />
) } export default PluginDependency