"use client"; import { useState } from "react"; import { Wifi } from "lucide-react"; import { fmtBytes } from "@/lib/utils"; import { Pagination } from "./Pagination"; interface Props { macBandwidth: any[]; } export default function AgentMacTab({ macBandwidth }: Props) { const [page, setPage] = useState(1); const pageSize = 50; const totalPages = Math.ceil(macBandwidth.length / pageSize); const startIndex = (page - 1) * pageSize; const paginated = macBandwidth.slice(startIndex, startIndex + pageSize); return (
{paginated.map((m, i) => { const maxTotal = macBandwidth.reduce((max: number, x: any) => Math.max(max, x.total ?? 0), 1); const pct = ((m.total ?? 0) / maxTotal) * 100; return (

{m.mac_address}

{m.manufacturer || "Unknown Manufacturer"}

{fmtBytes(m.total ?? 0)}

Total

DL: {fmtBytes(m.download ?? 0)} UL: {fmtBytes(m.upload ?? 0)}
); })}
); }