CI / changes (push) Successful in 13s
CI / commitlint (push) Has been skipped
CI / openapi (push) Has been skipped
CI / web (push) Successful in 1m6s
CI / go (push) Has been skipped
CI / bird2 (push) Has been skipped
CI / release (push) Successful in 4m17s
Updated multiple components to utilize the new PanelCard for better organization and presentation of content. Refactored DataGridShell, DataGridCard, and various analytics components to streamline layouts and enhance user experience. Adjusted styles for consistency across components, including pagination and toolbar elements, ensuring a cohesive interface throughout the application.
35 lines
906 B
TypeScript
35 lines
906 B
TypeScript
import {
|
|
Progress,
|
|
ProgressIndicator,
|
|
ProgressTrack,
|
|
} from '@evobgp/ui/components/progress'
|
|
import { cn } from '@evobgp/ui/lib/utils'
|
|
|
|
export function AnalyticsProgress({
|
|
label,
|
|
hint,
|
|
value,
|
|
className,
|
|
}: {
|
|
label: string
|
|
hint?: string
|
|
value: number
|
|
className?: string
|
|
}) {
|
|
const clamped = Math.max(0, Math.min(100, value))
|
|
return (
|
|
<div className={cn('space-y-2', className)}>
|
|
<div className="flex items-center justify-between gap-2 text-sm">
|
|
<span className="text-muted-foreground">{label}</span>
|
|
<span className="font-medium tabular-nums">{clamped}%</span>
|
|
</div>
|
|
{hint ? <p className="text-xs leading-snug text-muted-foreground">{hint}</p> : null}
|
|
<Progress value={clamped} className="w-full gap-0">
|
|
<ProgressTrack className="h-2">
|
|
<ProgressIndicator />
|
|
</ProgressTrack>
|
|
</Progress>
|
|
</div>
|
|
)
|
|
}
|