<%= paginate @endpoints %>

<table class="table">
  <thead>
    <tr>
      <th scope="col">Target URL</th>
      <th scope="col">ID</th>
      <th scope="col">Events</th>
      <th scope="col">Source</th>
      <th scope="col">User</th>
      <th scope="col">Created at</th>
    </tr>
  </thead>
  <tbody>
    <% @endpoints.each do |endpoint| %>
      <tr>
        <td><%= link_to endpoint.target_url, endpoint.target_url %></td>
        <td><%= endpoint.id %></td>
        <td><%= endpoint.events.join(", ") %></td>
        <td><%= endpoint.source %></td>
        <td><%= link_to endpoint.user.username, endpoint.user.path %></td>
        <td><%= endpoint.created_at.strftime("%H:%M %d %b %Y") %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= paginate @endpoints %>
