import type { KeyboardEvent, MouseEvent } from "react"; import { Banknote, CheckCircle2, Circle, FileText, Pill, UserPlus, Wrench, XCircle, type LucideIcon, } from "lucide-react"; import { fmt } from "@/lib/format"; import type { Activity } from "@/types"; import { cn } from "@/lib/utils"; const kindConfig: Record< Activity["kind"], { icon: LucideIcon; tone: string; tint: string } > = { claim_submitted: { icon: FileText, tone: "text-[hsl(var(--accent))]", tint: "bg-accent/10", }, claim_accepted: { icon: CheckCircle2, tone: "text-[hsl(var(--success))]", tint: "bg-[hsl(var(--success)/0.12)]", }, claim_paid: { icon: Banknote, tone: "text-[hsl(var(--success))]", tint: "bg-[hsl(var(--success)/0.12)]", }, claim_denied: { icon: XCircle, tone: "text-destructive", tint: "bg-destructive/12", }, remit_received: { icon: Pill, tone: "text-[hsl(var(--warning))]", tint: "bg-[hsl(var(--warning)/0.12)]", }, provider_added: { icon: UserPlus, tone: "text-foreground", tint: "bg-muted/60", }, manual_match: { icon: Wrench, tone: "text-muted-foreground", tint: "bg-muted/40", }, }; const FALLBACK_KIND: { icon: LucideIcon; tone: string; tint: string } = { icon: Circle, tone: "text-muted-foreground", tint: "bg-muted/40", }; export function ActivityFeed({ items, emptyMessage = "No activity yet.", onItemClick, }: { items: Activity[]; emptyMessage?: string; /** * Optional click handler for SP21 Universal Drill-Down (Task 2.5). * When provided, each row becomes a clickable target: the row's * outer `
  • ` gets `role="button"`, `tabIndex`, the `drillable` * hover affordance (chevron + tint), and an Enter/Space keybinding. * * `e.stopPropagation()` is called before invoking the handler so the * click doesn't bubble to a hypothetical parent row click — same * fix that landed on `DrillableCell` in Task 2.4. When omitted, the * feed renders exactly as before (no extra DOM, no extra attrs). */ onItemClick?: (event: Activity) => void; }) { if (items.length === 0) { return (
    {emptyMessage}
    ); } return ( ); }