import { Copy, Heart, PlugZap, ShieldBan } from 'lucide-react'; import { toast } from 'sonner'; import type { PushStreamView } from '../../../shared/api-types'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; import { formatMs, formatUptime, prettyCursor } from '@/lib/format'; import { ClientBadge } from './ClientBadge'; import { EraBadge } from './EraBadge'; export function PushStreamRow({ stream, nowMs, heartbeatSeq, onDrop, onRevoke, }: { stream: PushStreamView; nowMs: number; heartbeatSeq: number; onDrop: (streamId: string) => Promise; onRevoke: (streamId: string) => Promise; }) { const copyCursor = async () => { if (!stream.cursor) return; try { await navigator.clipboard.writeText(stream.cursor); toast.success('Copied stream cursor'); } catch { toast.error('Clipboard copy failed'); } }; return (
{stream.eventName}
Close gracefully; client reconnects from its cursor Send terminated / -32024 Forbidden so client removes subscription
{heartbeatSeq > 0 && ( )} {formatMs(stream.heartbeatMs)} up {formatUptime(stream.openedAt, nowMs)} delivered {stream.delivered}
); }