<h2><%= t("admin.administrators.search.title") %></h2>

<%= render "admin/shared/user_search", url: search_admin_administrators_path %>

<div id="administrators">
  <% if @users.any? %>
    <h3><%= page_entries_info @users %></h3>

    <table>
      <thead>
        <th scope="col"><%= Administrator.human_attribute_name(:name) %></th>
        <th scope="col"><%= Administrator.human_attribute_name(:email) %></th>
        <th scope="col"><%= t("admin.shared.actions") %></th>
      </thead>
      <tbody>
        <% @users.each do |user| %>
          <tr>
            <td><%= user.name %></td>
            <td><%= user.email %></td>
            <td>
              <%= render Admin::Roles::TableActionsComponent.new(user.administrator || user.build_administrator) %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>
  <% else %>
    <div class="callout alert margin">
      <%= t("admin.shared.no_search_results") %>
    </div>
  <% end %>
</div>
