<% content_for :title, t(".squawks", tail_number: @aircraft.tail_number) %> <%= render "shared/aircraft_header", aircraft: @aircraft %>

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

<% if @active.any? %><%= render "squawks/table", squawks: @active, aircraft: @aircraft %><% else %><%= empty_state t(".no_open_squawks") %><% end %>

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

<% if @resolved.any? %> <% @resolved.each do |s| %> <% end %>
<%= t(".priority") %><%= t(".issue") %><%= t(".resolution") %><%= t(".resolved") %>
<%= squawk_priority_badge(s) %> <%= s.issue_reported %><%= render "squawks/attachments", squawk: s %> <%= s.notes %><% if s.logbook_entry %>
<%= link_to t(".logbook", date: fmt_date(s.logbook_entry.date)), aircraft_logbook_entry_path(@aircraft, s.logbook_entry), class: "link" %>
<% end %>
<%= fmt_date(s.resolved_at&.to_date) %> <% if owner? %><%= button_to t(".reopen"), reopen_aircraft_squawk_path(@aircraft, s), method: :patch, class: "btn-secondary btn-sm" %><% end %>
<% else %> <%= empty_state t(".no_resolved_squawks") %> <% end %>