import { Copy, ShieldBan } from 'lucide-react'; import { toast } from 'sonner'; import type { PollerView } 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, prettyCursor, relativeTime } from '@/lib/format'; import { ClientBadge } from './ClientBadge'; import { EraBadge } from './EraBadge'; import { cn } from '@/lib/utils'; export function PollerRow({ poller, nowMs, onRevoke, }: { poller: PollerView; nowMs: number; onRevoke: (pollerId: string) => Promise; }) { const dotClass = poller.status === 'active' ? 'bg-emerald-400' : poller.status === 'idle' ? 'bg-event' : 'bg-zinc-500'; const copyCursor = async () => { if (!poller.cursor) return; try { await navigator.clipboard.writeText(poller.cursor); toast.success('Copied poller cursor'); } catch { toast.error('Clipboard copy failed'); } }; return (
{poller.revokePending && ( revoke pending )}
{poller.eventName}
Return -32024 Forbidden on this poller's next events/poll
polls {poller.polls} delivered {poller.delivered} last {relativeTime(poller.lastPollAt, nowMs)} next ≤ {formatMs(poller.nextPollMs)}
); }