import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' import { ErrorPluginsSection, RunningPluginsSection, SuccessPluginsSection, } from './plugin-task-list' import PluginTaskTrigger from './plugin-task-trigger' import { usePluginTaskPanel } from './use-plugin-task-panel' const PluginTasks = () => { const { open, setOpen, tip, taskStatus, handleClearAll, handleClearErrors, handleClearSingle, } = usePluginTaskPanel() const { errorPlugins, successPlugins, runningPlugins, runningPluginsLength, successPluginsLength, errorPluginsLength, totalPluginsLength, isInstalling, isInstallingWithSuccess, isInstallingWithError, isSuccess, isFailed, } = taskStatus // Show icon if there are any plugin tasks (completed, running, or failed) // Only hide when there are absolutely no plugin tasks if (totalPluginsLength === 0) return null const canOpenPanel = isFailed || isInstalling || isInstallingWithSuccess || isInstallingWithError || isSuccess return (