'use client'; import { X, History } from 'lucide-react'; import { cn } from '@/lib/utils'; // Assuming this exists or I'll use the local cn interface LogsOverlayProps { show: boolean; onClose: () => void; logs: any[]; inventory: any[]; } export default function LogsOverlay({ show, onClose, logs, inventory }: LogsOverlayProps) { if (!show) return null; return (

Audit History

Live transaction log from cloud

{logs.length === 0 ? (

No transactions found

) : ( logs.map((log) => (

{log.action}

by {log.username || 'System'}
{inventory.find(i => i.id === log.target_item_id)?.name || `Item #${log.target_item_id}`}
{(log.details || log.timestamp) && (

{new Date(log.timestamp).toLocaleString()}

{log.details && ( {log.details} )}
)}

0 ? "text-green-400" : "text-rose-400" }`}> {log.quantity_change > 0 ? '+' : ''}{log.quantity_change}

)) )}
); }