(reports, activeId = "")
| 2925 | } |
| 2926 | |
| 2927 | function renderReportList(reports, activeId = "") { |
| 2928 | const target = $("reportsList"); |
| 2929 | if (!reports.length) { |
| 2930 | target.className = "reports-list empty"; |
| 2931 | target.textContent = ui().reports.none; |
| 2932 | return; |
| 2933 | } |
| 2934 | target.className = "reports-list"; |
| 2935 | target.innerHTML = reports.map((report) => ` |
| 2936 | <button class="report-row ${report.report_id === activeId ? "active" : ""} ${state.highlightedReports.has(report.report_id) ? "highlighted" : ""}" data-report-id="${escapeHtml(report.report_id)}" type="button"> |
| 2937 | <h3>${escapeHtml(report.title || ui().reports.defaultTitle)}</h3> |
| 2938 | <p>${escapeHtml(report.saved_at || "")} · ${escapeHtml(report.status || ui().reports.completed)}</p> |
| 2939 | <p>${escapeHtml(report.snippet || report.report_path || "")}</p> |
| 2940 | </button> |
| 2941 | `).join(""); |
| 2942 | } |
| 2943 | |
| 2944 | function clearReportViewer() { |
| 2945 | state.currentReport = null; |
no test coverage detected