import { RiCheckboxCircleFill, RiErrorWarningFill, RiInstallLine, } from '@remixicon/react' import ProgressCircle from '@/app/components/base/progress-bar/progress-circle' import Tooltip from '@/app/components/base/tooltip' import DownloadingIcon from '@/app/components/header/plugins-nav/downloading-icon' import { cn } from '@/utils/classnames' type PluginTaskTriggerProps = { tip: string isInstalling: boolean isInstallingWithSuccess: boolean isInstallingWithError: boolean isSuccess: boolean isFailed: boolean successPluginsLength: number runningPluginsLength: number errorPluginsLength: number totalPluginsLength: number } const PluginTaskTrigger = ({ tip, isInstalling, isInstallingWithSuccess, isInstallingWithError, isSuccess, isFailed, successPluginsLength, runningPluginsLength, errorPluginsLength, totalPluginsLength, }: PluginTaskTriggerProps) => { const showDownloadingIcon = isInstalling || isInstallingWithError const hasError = isInstallingWithError || isFailed const showSuccessIndicator = isSuccess || (successPluginsLength > 0 && runningPluginsLength === 0 && errorPluginsLength === 0) return (
{/* Main Icon */} {showDownloadingIcon ? : ( )} {/* Status Indicator */}
{(isInstalling || isInstallingWithSuccess) && ( )} {isInstallingWithError && ( )} {showSuccessIndicator && ( )} {isFailed && ( )}
) } export default PluginTaskTrigger