import React from "react"; import { cn } from "@/lib/utils"; import { formatBytes } from "@/lib/format"; import AnimatedCircularProgressBar from "./ui/animated-circular-progress-bar"; import { CircleStackIcon } from "@heroicons/react/24/outline"; interface CycleTransferStatsClientProps { name: string; from: string; to: string; max: number; serverStats: Array<{ serverId: string; serverName: string; transfer: number; nextUpdate: string; }>; className?: string; } export const CycleTransferStatsClient: React.FC< CycleTransferStatsClientProps > = ({ name, from, to, max, serverStats, className }) => { return (
{serverStats.map(({ serverId, serverName, transfer, nextUpdate }) => { const progress = (transfer / max) * 100; return (
{name}
{new Date(from).toLocaleDateString()} -{" "} {new Date(to).toLocaleDateString()}
{serverName}

{progress.toFixed(0)}%

{formatBytes(transfer)} used {formatBytes(max)} total
Next update: {new Date(nextUpdate).toLocaleString()}
); })}
); }; export default CycleTransferStatsClient;