<h1>Admin Dashboard</h1>
<a href="/admin/add">Add New Blog</a> | <a href="/admin/logout">Logout</a>
<ul>
  <% blogs.forEach(blog => { %>
    <li>
      <strong><%= blog.title %></strong>
      [<a href="/admin/edit/<%= blog.id %>">Edit</a> |
       <form method="POST" action="/admin/delete/<%= blog.slug %>" onsubmit="return confirmDelete()">
  <button type="submit">🗑️ Delete</button>
</form> ]

<script>
  function confirmDelete() {
    return confirm("Are you sure you want to delete this blog post?");
  }
</script>

    </li>
  <% }) %>
</ul>
