feat: add NumberFlowSize component and integrate it into DashboardPage for improved size display
This commit is contained in:
@@ -4,10 +4,9 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Volume2, Play, Clock, HardDrive, Music, Trophy, Loader2, RefreshCw } from 'lucide-react'
|
||||
import { formatDuration } from '@/lib/format'
|
||||
import NumberFlow from '@number-flow/react'
|
||||
import { formatSizeObject } from '@/utils/format-size'
|
||||
import { NumberFlowDuration } from '@/components/ui/number-flow-duration'
|
||||
import { NumberFlowSize } from '@/components/ui/number-flow-size'
|
||||
|
||||
interface SoundboardStatistics {
|
||||
sound_count: number
|
||||
@@ -315,14 +314,7 @@ export function DashboardPage() {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">
|
||||
{(() => {
|
||||
const sizeObj = formatSizeObject(soundboardStatistics.total_size, true)
|
||||
return (
|
||||
<>
|
||||
<NumberFlow value={sizeObj.value} /> {sizeObj.unit}
|
||||
</>
|
||||
)
|
||||
})()}
|
||||
<NumberFlowSize size={soundboardStatistics.total_size} binary={true} />
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Original + normalized files
|
||||
@@ -384,14 +376,7 @@ export function DashboardPage() {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">
|
||||
{(() => {
|
||||
const sizeObj = formatSizeObject(trackStatistics.total_size, true)
|
||||
return (
|
||||
<>
|
||||
<NumberFlow value={sizeObj.value} /> {sizeObj.unit}
|
||||
</>
|
||||
)
|
||||
})()}
|
||||
<NumberFlowSize size={trackStatistics.total_size} binary={true} />
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Original + normalized files
|
||||
|
||||
Reference in New Issue
Block a user