import Link from "next/link"; import { Table, TableBody, TableCell, TableEmpty, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { StatusBadge } from "@/components/ui/badge"; import { CopyButton } from "@/components/ui/copy-button"; import { formatDate, formatNumber, timeAgo } from "@/lib/format"; import type { SessionRow } from "@/lib/queries/dashboard"; import { CloseSessionButton } from "./close-session-button"; function expiresIn(d: Date): string { const diff = d.getTime() - Date.now(); if (diff <= 0) return "expired"; const s = Math.round(diff / 1000); if (s < 60) return `in ${s}s`; const m = Math.round(s / 60); if (m < 60) return `in ${m}m`; return `in ${Math.round(m / 60)}h`; } export function SessionsTable({ rows }: { rows: SessionRow[] }) { return (