{% include "header.html" %}

{% if users %}
<h1 class="text-4xl py-2">Users</h1>
<table class="table-auto m-auto w-full">
  <thead>
    <tr class="text-left">
      <th class="p-2 pl-4"> Email </th>
      <th class="p-2 pl-4"> DeviceId </th>
      <th class="p-2 pl-4"> Books </th>
    </tr>
  </thead>
  <tbody>
    {% for user in users %}
    <tr class="p-2">
      <td class="border px-4 p-1">{{ user.Email }}</td>
      <td class="border px-4 p-1">{{ user.DeviceId }}</td>
      <td class="border px-4 p-1">
        <a href="/user/{{ user.UserKey }}/book" class="text-blue-700">books</a>
      </td>
      <td class="border px-4 p-1 cursor-pointer">
        <form method="POST" action="/user/{{ user.UserKey }}/remove">
          <input type="submit" value="Delete User" class="cursor-pointer">
        </form>
      </td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endif %}

<h1 class="text-2xl mt-6">Add User</h1>
{% include "error.j2" %}
{% include "activation_form.html" %}

{% include "footer.html" %}
