import Link from "next/link"; import { Table, TableBody, TableCell, TableEmpty, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Badge, StatusBadge } from "@/components/ui/badge"; import { formatBytes, formatDate, formatMs, formatUsd, timeAgo } from "@/lib/format"; import type { RequestListRow } from "@/lib/queries/dashboard"; import { cn } from "@/lib/utils"; export function NetworkLabel({ network, requested }: { network: string | null; requested?: string }) { if (!network) return —; return ( {network === "isp" ? "ISP" : network} {requested && requested !== "auto" && requested !== network ? ( (asked {requested}) ) : null} ); } export function HttpCode({ code }: { code: number | null }) { if (code === null) return —; const tone = code < 300 ? "text-success" : code < 400 ? "text-info" : code < 500 ? "text-warning" : "text-danger"; return {code}; } /** Request log table. `compact` hides secondary columns (used on the Overview). */ export function RequestsTable({ rows, compact, emptyMessage = "No requests match these filters." }: { rows: RequestListRow[]; compact?: boolean; emptyMessage?: React.ReactNode }) { const cols = compact ? 7 : 11; return (