feat: add NumberFlowSize component and integrate it into DashboardPage for improved size display
This commit is contained in:
22
src/components/ui/number-flow-size.tsx
Normal file
22
src/components/ui/number-flow-size.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user