<%- include("../includes/header.ejs", {title: "Admin"}) %>
<div class="overflow-x-auto relative">
  <table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
    <thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
      <tr>
        <th scope="col" class="py-3 px-6">
          Bot Name
        </th>
        <th scope="col" class="py-3 px-6">
          BotID
        </th>
        <th scope="col" class="py-3 px-6">
          Bot Description
        </th>
        <th scope="col" class="py-3 px-6">
          Owner
        </th>
        <th scope="col" class="py-3 px-6">
          Verify
        </th>
      </tr>
    </thead>
    <tbody>
      <% var nbots = bots.filter(bot => bot.verified == false); %>
      <% nbots.forEach(function(bot) { %>
      <tr class="hover:bg-gray-100 dark:hover:bg-gray-800">
        <td class="py-3 px-6">
          <%= bot.name %>
        </td>
        <td class="py-3 px-6">
          <%= bot.id %>
        </td>
        <td class="py-3 px-6">
          <%= bot.description %>
        </td>
        <td class="py-3 px-6">
          <%= bot.owner %>
        </td>
        <td class="py-3 px-6">
          <form action="/admin/bot/<%= bot.id %>/verify" method="post">
            <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full" type="submit">
              Verify
            </button>
          </form>
          <button class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full" onclick="location.href='/admin/bot/<%= bot.id %>/reject'">
            Reject
          </button>
        </td>
      </tr>
      <% }) %>

    </tbody>
  </table>
</div>