<div class="card with-overflow" id='user-groups'>
  <div class="card-divider">
    <h2 class="card-title">
      <%= t ".title" %>
      <%= link_to t(".actions.new_delegation"), decidim_admin_action_delegator.new_setting_delegation_path(current_setting), class: "button tiny button--title" %>
    </h2>
  </div>
  <div class="card-section">
    <div class="table-scroll">
      <table class="table-list">
        <thead>
          <tr>
            <th><%= t(".granter") %></th>
            <th><%= t(".grantee") %></th>
            <th><%= t(".created_at") %></th>
            <th>&nbsp;</th>
          </tr>
        </thead>
        <tbody>
          <% @delegations.each do |delegation| %>
            <tr data-delegation-id="<%= delegation.id %>">
              <td><%= delegation.granter.name %></td>
              <td><%= delegation.grantee.name %></td>
              <td><%= l delegation.created_at, format: :short %></td>

              <td class="table-list__actions">
                <%= icon_link_to "circle-x", decidim_admin_action_delegator.setting_delegation_path(delegation.setting, delegation), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
              </td>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
    <%= decidim_paginate @delegations %>
  </div>
</div>