<% content_for :title, t(".invitations") %>

<%= t(".invitations") %>

<%= link_to t(".new_invitation"), new_admin_invitation_path, class: "btn-primary" %>

<%= t(".intro") %>

<% if @invitations.any? %> <% @invitations.each do |inv| %> <% end %>
<%= t(".label") %><%= t(".gives") %><%= t(".uses") %><%= t(".status") %>
<%= inv.label %>
<%= [ inv.email, inv.created_by&.display_name, fmt_date(inv.created_at) ].compact.join(" · ") %>
"><%= inv.grants.map { "#{_1.aircraft.tail_number} (#{_1.role.name})" }.join(", ").presence || t(".account_only") %> "><%= inv.uses_count %> / <%= inv.max_uses || "∞" %> "> <% if inv.revoked? %><%= t(".revoked") %> <% elsif inv.expired? %><%= t(".expired") %> <% elsif inv.used_up? %><%= t(".used") %> <% else %><%= t(".active") %><%= inv.expires_at ? t(".until", time: l(inv.expires_at, format: :app)) : t(".never_expires") %><% end %> <% if inv.usable? %><%= delete_button t(".revoke"), admin_invitation_path(inv), confirm: t(".revoke_invitation") %><% end %>
<% else %> <%= empty_state t(".no_invitations") %> <% end %>