import { CheckCircle, XCircle, AlertTriangle } from "lucide-react"; import type { ActionReceipt } from "../types"; import { cn, formatRelativeTime } from "../utils"; import OnboardingCard from "./OnboardingCard"; interface Props { receipts: ActionReceipt[]; isLoading: boolean; error: unknown; onSelect: (r: ActionReceipt) => void; selectedId: string | null; hasMore: boolean; onLoadMore: () => void; loadingMore?: boolean; } const tierBadge: Record = { low: "bg-emerald-500/10 text-emerald-400", medium: "bg-yellow-500/10 text-yellow-400", high: "bg-red-500/10 text-red-400", }; export default function ReceiptList({ receipts, isLoading, error, onSelect, selectedId, hasMore, onLoadMore, loadingMore = false, }: Props) { if (receipts.length === 0) { return ; } return (
Tool Tier Time Status Anomaly
{receipts.map((r) => (
onSelect(r)} onKeyDown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); onSelect(r); } }} className={cn( "grid grid-cols-[1fr_80px_90px_40px_40px] gap-2 items-center px-3 py-2 rounded-lg cursor-pointer transition-colors", selectedId === r.id ? "bg-neutral-800/50 border-l-2 border-emerald-400" : "hover:bg-neutral-800/30 border-l-2 border-transparent", )} > {r.toolName} {r.tier} {formatRelativeTime(r.timestamp)} {r.success ? ( ) : ( )} {r.anomalies.length > 0 ? ( ) : ( )}
))}
{hasMore && (
)}
); }