diff --git a/apps/web/app/stats/stats-sections.tsx b/apps/web/app/stats/stats-sections.tsx index da09444a14..3893695fef 100644 --- a/apps/web/app/stats/stats-sections.tsx +++ b/apps/web/app/stats/stats-sections.tsx @@ -4,21 +4,7 @@ import { IconGitCommit } from "@tabler/icons-react"; import { Card, CardContent, CardHeader, CardTitle } from "@kandev/ui/card"; import { Tooltip, TooltipContent, TooltipTrigger } from "@kandev/ui/tooltip"; import type { StatsResponse, TaskStatsDTO, RepositoryStatsDTO } from "@/lib/types/http"; - -function formatDuration(ms: number): string { - if (ms === 0) return "\u2014"; - const seconds = Math.floor(ms / 1000); - const minutes = Math.floor(seconds / 60); - const hours = Math.floor(minutes / 60); - - if (hours > 0) { - return `${hours}h ${minutes % 60}m`; - } - if (minutes > 0) { - return `${minutes}m ${seconds % 60}s`; - } - return `${seconds}s`; -} +import { formatDuration } from "./stats-utils"; function formatPercent(value: number): string { return `${Math.round(value)}%`;