// Network detail with per-network tabs const { useState: useStateN, useEffect: useEffectN } = React; function fmtBytes(b) { if (!b || b === 0) return "0 B"; if (b >= 1e9) return (b / 1e9).toFixed(1) + " GB"; if (b >= 1e6) return (b / 1e6).toFixed(1) + " MB"; if (b >= 1e3) return (b / 1e3).toFixed(0) + " KB"; return b + " B"; } function NetworkDetail({ ctx }) { const { t, networkId } = ctx; const [net, setNet] = useStateN(null); const [tab, setTab] = useStateN("devices"); useEffectN(() => { if (!networkId) return; ww.get("/networks/" + networkId).then(setNet).catch(() => {}); }, [networkId]); const role = net ? net.my_role : ""; if (!net) return
{t.network.deleteBody}