feat: 更新仪表盘标题和描述,添加异常状态查询字段,优化管理员导航和API导出
This commit is contained in:
34
src/components/ui/progress.tsx
Normal file
34
src/components/ui/progress.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type ProgressProps = React.ComponentProps<"div"> & {
|
||||
/** 0–100 */
|
||||
value?: number;
|
||||
};
|
||||
|
||||
function Progress({ className, value = 0, ...props }: ProgressProps): React.ReactElement {
|
||||
const pct = Math.min(100, Math.max(0, Number.isFinite(value) ? value : 0));
|
||||
return (
|
||||
<div
|
||||
role="progressbar"
|
||||
aria-valuenow={Math.round(pct)}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
className={cn(
|
||||
"relative h-2 w-full overflow-hidden rounded-full bg-muted",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<div
|
||||
className="h-full bg-primary transition-[width] duration-500 ease-out"
|
||||
style={{ width: `${pct}%` }}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export { Progress };
|
||||
Reference in New Issue
Block a user