import type { Torrent } from '../shared'; import { Lock } from 'lucide-react'; import { describePeerFlags, formatPercent, formatSpeed } from '../format'; // Connected peers. Not sortable and not virtualised on purpose: the list is capped by the torrent's peer // limit (50 by default), it churns every poll, and a sort you have to re-establish every five seconds is // worse than no sort. type PeersTabProps = { torrent: Torrent }; const HEAD = 'px-3 py-1.5 text-left text-[11px] font-medium uppercase tracking-wide text-muted-foreground'; export const PeersTab = ({ torrent }: PeersTabProps) => { const peers = torrent.peers ?? []; if (!peers.length) { return
No peers connected.
; } return (| Address | Client | Progress | Down | Up | Flags |
|---|---|---|---|---|---|
|
{peer.isEncrypted && |
{peer.clientName || '—'} | {formatPercent(peer.progress)} | {formatSpeed(peer.rateToClient)} | {formatSpeed(peer.rateToPeer)} | {peer.flagStr} |