import * as React from 'react' import { cn } from '../../lib/utils' import { Inbox } from 'lucide-react' import { formatRelativeTime } from '../../utils' import { HealthCard, HealthDot } from './HealthCard' import { worstStatus, type HealthStatus } from './health-status' export interface AttentionItem { id: string label: string /** Optional context line, e.g. "Weekly brief · awaiting review". */ meta?: string /** Link target; when set the row is a link. */ href?: string /** Row tone (default warn — it's in the attention queue for a reason). */ tone?: HealthStatus /** Timestamp shown as relative time on the right. */ at?: string | Date | null } export interface AttentionFeedProps { title?: string items: AttentionItem[] limit?: number emptyMessage?: string className?: string } /** * The "needs a human" queue: records flagged for review across every type. Empty * is the healthy state (all clear); anything in the queue pulls the card to warn * (or worse, per item tone). Presentational — a tenant widget collects the items * from whatever it considers actionable (stuck records, drafts awaiting review…). */ export function AttentionFeed({ title = 'Needs attention', items, limit, emptyMessage = 'All clear — nothing needs review.', className, }: AttentionFeedProps) { const status: HealthStatus = items.length === 0 ? 'ok' : worstStatus(items.map((it) => it.tone ?? 'warn')) const statusLabel = items.length === 0 ? 'All clear' : `${items.length} to review` const listed = limit ? items.slice(0, limit) : items return ( ) }