<%- include('../partials/head', { pageType: 'admin' }) %>
<%- include('../partials/admin-header', { activeAdminTab: 'comments', stats }) %>
All (<%= counts.all %>) Pending (<%= counts.pending %>) Approved (<%= counts.approved %>) Spam (<%= counts.spam %>)
<% if (q) { %> × <% } %>

<%= status === 'all' ? 'All Comments' : (status === 'pending' ? 'Pending Moderation Queue' : (status === 'approved' ? 'Approved Comments' : 'Spam Queue')) %> <%= totalComments %> total

<% if (totalPages > 1) { %>
Page <%= page %> of <%= totalPages %>
<% } %>
<% if (comments.length === 0) { %>

💭 No comments found in this view.

<%= q ? `No results matching "${q}". Try clearing your search.` : 'You are all caught up!' %>

<% } else { %>
<% comments.forEach(c => { const initials = (c.author_name || 'Anonymous') .split(' ') .map(n => n[0]) .slice(0, 2) .join('') .toUpperCase(); %>
<%= initials %>
<%= c.author_name %> <%= c.approved === 1 ? 'Approved' : (c.approved === 0 ? 'Pending Moderation' : 'Spam') %>
<% if (c.author_email) { %> ✉️ <%= c.author_email %> <% } else { %> (No email provided) <% } %> <% if (c.author_website) { %> 🌐 <%= c.author_website.replace(/^https?:\/\//, '').replace(/\/$/, '') %> ↗ <% } %> <% if (c.ip) { %> 📍 <%= c.ip %> <% } %>
<%= new Date(c.created_at).toLocaleString() %>

<%= c.body %>

<% if (c.approved !== 1) { %> <% } %> <% if (c.approved !== -1) { %> <% } %>
<% }) %>
<% } %> <% if (totalPages > 1) { %>
<% if (page > 1) { %> ← Previous <% } %> <% for (let p = 1; p <= totalPages; p++) { %> <%= p %> <% } %> <% if (page < totalPages) { %> Next → <% } %>
<% } %>
<%- include('../partials/foot', { pageType: 'admin' }) %>