%# Header + tab bar shown on every aircraft page. %>
<% aw = aircraft.airworthiness %>
<% if aircraft.picture_shown? %>
<%= image_tag aircraft.picture_for(:thumb), width: 48, height: 48, class: "h-12 w-12 rounded-md object-cover", alt: "" %>
<% end %>
<%= link_to aircraft.tail_number, aircraft_path(aircraft) %>
<%= [aircraft.make, aircraft.model].compact_blank.join(" ") %>
<%= airworthiness_badge(aw) %>
<%= aircraft_status_badge(aircraft) unless aircraft.status == "AVAILABLE" %>
<%= t(".tach_hobbs_html", tach_time: (hours(aircraft.tach_time)), hobbs_time: (hours(aircraft.hobbs_time))) %>
"><%= (current_user.aircraft_roles.find_by(aircraft: aircraft)&.role || current_role).capitalize %>
<%= link_to t(".log_flight"), new_aircraft_flight_log_path(aircraft), class: "btn-primary" %>
<%= link_to t(".report_squawk"), new_aircraft_squawk_path(aircraft), class: "btn-secondary" %>
<%= more_menu do %>
<%= link_to t(".status_report"), aircraft_report_path(aircraft), class: "menu-item" %>
<% if owner? %>
<%= link_to t(".access_sharing"), aircraft_aircraft_roles_path(aircraft), class: "menu-item" %>
<%= link_to t(".edit_aircraft"), edit_aircraft_path(aircraft), class: "menu-item" %>
<%= link_to t(".download_sam_zip"), aircraft_export_path(aircraft), class: "menu-item", data: { turbo: false } %>
<%= link_to t(".download_records_package"), aircraft_records_package_path(aircraft), class: "menu-item", data: { turbo: false } %>
<% end %>
<% end %>
<% tabs = aircraft_tabs(aircraft) %>
<% current_tab = tabs.find { |_, _, names| names.include?(controller_name) } %>
<%# Phones: the current section, with every section a tap away. %>