'use client'; import React from 'react'; import { Stack, LinearProgress, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; // 任务进度组件 export default function TaskProgress({ task }) { const { t } = useTranslation(); // 如果没有总数,则不显示进度条 if (task.totalCount === 0) return '-'; // 计算进度百分比 const progress = (task.completedCount / task.totalCount) * 100; return ( {task.completedCount} / {task.totalCount} ({Math.round(progress)}%) ); }