feat: add NumberFlowSize component and integrate it into DashboardPage for improved size display

This commit is contained in:
JSC
2025-08-12 22:15:04 +02:00
parent ccd5973db9
commit 7ebeac1280
3 changed files with 25 additions and 56 deletions

View File

@@ -0,0 +1,22 @@
import NumberFlow from '@number-flow/react'
import { formatSizeObject } from '@/utils/format-size'
interface NumberFlowSizeProps {
size: number
binary?: boolean
className?: string
}
export function NumberFlowSize({
size,
binary = true,
className
}: NumberFlowSizeProps) {
const sizeObj = formatSizeObject(size, binary)
return (
<span className={className}>
<NumberFlow value={sizeObj.value} /> {sizeObj.unit}
</span>
)
}