feat: 添加列表视图进度条选项并优化进度条显示

This commit is contained in:
Montia37
2025-09-05 19:35:29 +08:00
parent e6dc8b1776
commit a649945566
8 changed files with 84 additions and 36 deletions

View File

@@ -1,13 +1,19 @@
import { getProgressBarClass } from "@/utils";
export const ProgressBar = ({
value,
h = "h-3",
className,
}: {
value: number;
h?: string;
className?: string;
}) => (
<div className="w-full bg-gray-200 rounded-full h-3 dark:bg-gray-700">
<div className={`w-full bg-gray-200 rounded-full ${h} dark:bg-gray-700`}>
<div
className={`h-3 rounded-full transition-all duration-500 ${className}`}
className={`${h} rounded-full transition-all duration-500 ${getProgressBarClass(
value
)} ${className}`}
style={{ width: `${value}%` }}></div>
</div>
);