document.addEventListener('DOMContentLoaded', function() { // Button event handlers document.addEventListener('click', function(e) { // Handle export button if (e.target.closest('.export-btn')) { alert('Exporting data... This would trigger a CSV download in a real application.'); } // Handle filter button if (e.target.closest('.filter-btn')) { alert('Opening filters... This would show filter options in a real application.'); } // Handle pagination buttons if (e.target.closest('.pagination-btn')) { const btn = e.target.closest('.pagination-btn'); if (!btn.classList.contains('bg-blue-600')) { alert(`Loading page ${btn.textContent}... This would load new data in a real application.`); } } // Handle time period selector if (e.target.closest('.time-period-select')) { const select = e.target.closest('.time-period-select'); alert(`Changed time period to ${select.value}. This would reload data with new time range in a real application.`); } // Handle view transaction button if (e.target.closest('.view-btn')) { alert('Viewing transaction details... This would open a modal in a real application.'); } // Handle more options button if (e.target.closest('.options-btn')) { alert('Showing more options... This would open a dropdown menu in a real application.'); } }); // Network selector handler document.addEventListener('change', function(e) { if (e.target.classList.contains('asset-select')) { alert(`Changed asset to ${e.target.value}. This would update the chart in a real application.`); } }); // Sample transaction data (would be replaced with actual data in a real app) const transactions = [ { date: '2025-01-02 16:07:48 UTC', type: 'Product Checkout', product: 'Activation Upgrade', network: 'Base', asset: 'ETH', amount: '$17.97', status: 'Completed' }, { date: '2025-01-04 18:28:43 UTC', type: 'Product Checkout', product: 'Activation Upgrade', network: 'Polygon', asset: 'MATIC', amount: '$5.99', status: 'Completed' }, { date: '2025-01-05 07:30:34 UTC', type: 'Product Checkout', product: 'Activation Upgrade', network: 'Base', asset: 'ETH', amount: '$17.97', status: 'Completed' }, { date: '2025-01-05 13:00:08 UTC', type: 'Product Checkout', product: 'Activation Upgrade', network: 'Polygon', asset: 'USDC', amount: '$5.99', status: 'Completed' }, { date: '2025-01-06 05:21:18 UTC', type: 'Product Checkout', product: 'Activation Upgrade', network: 'Polygon', asset: 'MATIC', amount: '$5.99', status: 'Completed' } ]; // Populate transaction table const tableBody = document.getElementById('transactionTableBody'); transactions.forEach(tx => { const row = document.createElement('tr'); const statusClass = tx.status === 'Completed' ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800'; row.innerHTML = `