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

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

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

<%= t(".what_html", docs: link_to(t(".api_docs"), help_page_path("api"), class: "link")) %>

<% if @integrations.any? %>
<% @integrations.each do |i| %><% end %>
<%= t(".name") %><%= t(".aircraft") %><%= t(".webhook") %><%= t(".last_used") %>
<%= link_to i.name, admin_integration_path(i), class: "link font-medium" %> <% if i.revoked? %><%= t(".revoked") %><% end %>
<%= i.token_hint %>…
<%= Aircraft.where(id: Array(i.aircraft_ids)).order(:tail_number).pluck(:tail_number).join(", ").presence || "—" %> <%= (e = i.webhook_endpoints.first) ? e.url : "—" %> <%= i.last_used_at ? t(".ago", ago: time_ago_in_words(i.last_used_at)) : t(".never") %>
<% else %> <%= empty_state t(".none_yet") %> <% end %>