`;
};
const renderRecommendations = (recommendations) => {
const recsContainer = document.getElementById('recommendations-list');
const icons = {
'zap': '',
'alert-triangle': '',
'user-plus': '',
'smartphone': '',
'monitor': '',
'shield-check': '',
'git-branch': '',
};
recsContainer.innerHTML = recommendations.map(rec => `
${icons[rec.icon]}
`).join('');
};
// --- EVENT HANDLERS ---
const handleNavClick = () => {
if(currentTab === 'config') showTab('dashboard');
else showTab('config');
};
const generatePDF = () => {
const pdfContent = document.getElementById('pdf-content');
const pdfBtnContainer = document.getElementById('pdf-button-container');
if (!pdfContent || !pdfBtnContainer) return;
pdfBtnContainer.style.display = 'none';
html2canvas(pdfContent, { scale: 2, useCORS: true }).then(canvas => {
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' });
const pdfWidth = pdf.internal.pageSize.getWidth();
const imgWidth = pdfWidth - 20;
const imgHeight = (canvas.height * imgWidth) / canvas.width;
pdf.setFontSize(22);
pdf.setFont('helvetica', 'bold');
pdf.text('One-Tap Checkout Report', pdfWidth / 2, 15, { align: 'center' });
pdf.addImage(imgData, 'PNG', 10, 25, imgWidth, imgHeight);
pdf.save('one-tap-checkout-report.pdf');
pdfBtnContainer.style.display = 'block';
});
};
// --- ATTACH LISTENERS ---
prevBtn.addEventListener('click', () => showTab('config'));
nextBtn.addEventListener('click', handleNavClick);
tabButtons.config.addEventListener('click', () => showTab('config'));
tabButtons.dashboard.addEventListener('click', () => showTab('dashboard'));
downloadPdfBtn.addEventListener('click', generatePDF);
});
${rec.text}
