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

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

<%= more_menu do %><%= link_to t(".import_from_a_sam_zip"), new_aircraft_import_path, class: "menu-item" %><% end %> <%= link_to t(".add_aircraft"), new_aircraft_path, class: "btn-primary" %>
<% if @aircraft_list.empty? %>

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

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

<% else %>
<% @aircraft_list.each do |aircraft| %> <% aw = aircraft.airworthiness %> <%= link_to aircraft_path(aircraft), class: "card block overflow-hidden transition hover:shadow-md" do %>
<% if aircraft.picture.attached? %> <%= image_tag aircraft.picture_for(:card), class: "h-full w-full object-cover", loading: "lazy", alt: t(".photo_of", tail_number: aircraft.tail_number) %> <% else %> <% end %>
<%= aircraft.tail_number %>
<%= [aircraft.make, aircraft.model].compact_blank.join(" ").presence || "—" %>
<%= airworthiness_badge(aw) %>
<%= t(".tach_html", tach_time: (hours(aircraft.tach_time))) %> <%= aircraft_status_badge(aircraft) %>
<% if aw.issues.any? %> <% end %>
<% end %> <% end %>
<% end %>