<% content_for :title, "#{@aircraft.tail_number} Squawks" %> <%= render "shared/aircraft_header", aircraft: @aircraft %>

Open Squawks

<%= link_to "+ Report Squawk", new_aircraft_squawk_path(@aircraft), class: "btn-primary" %>
<% if @active.any? %><%= render "squawks/table", squawks: @active, aircraft: @aircraft %><% else %><%= empty_state "No open squawks." %><% end %>

Resolved

<% if @resolved.any? %> <% @resolved.each do |s| %> <% end %>
PriorityIssueResolutionResolved
<%= squawk_priority_badge(s) %> <%= s.issue_reported %><%= render "squawks/attachments", squawk: s %> <%= s.notes %><% if s.logbook_entry %>
<%= link_to "Logbook #{s.logbook_entry.date}", aircraft_logbook_entry_path(@aircraft, s.logbook_entry), class: "link" %>
<% end %>
<%= s.resolved_at&.to_date %> <% if owner? %><%= button_to "Reopen", reopen_aircraft_squawk_path(@aircraft, s), method: :patch, class: "btn-secondary btn-sm" %><% end %>
<% else %> <%= empty_state "No resolved squawks." %> <% end %>