import type { ReactNode } from 'react';
import type { Torrent } from '../shared';
import { Check, Copy } from 'lucide-react';
import { useState } from 'react';
import {
formatDate,
formatDuration,
formatEta,
formatPercent,
formatRatio,
formatSize,
formatSpeed,
PRIORITY_LABELS,
statusLabel,
} from '../format';
import { copyToClipboard } from 'helpers/clipboard';
// The "what is this torrent" tab: transfer numbers, then the immutable facts from the metainfo.
type GeneralTabProps = { torrent: Torrent };
export const GeneralTab = ({ torrent: t }: GeneralTabProps) => (
{t.error !== 0 && t.errorString && (
{t.errorString}
)}
= 1 ? '—' : formatEta(t.eta)} />
{/* Corrupt bytes are re-downloaded silently, so this is the only place a failing disk or a bad peer
shows up before the ratio quietly goes wrong. */}
{t.labels.length > 0 && }
{t.comment && }
{t.peersFrom && (
)}