% content_for :title, t(".resolve_squawk") %>
<%= render "shared/aircraft_header", aircraft: @aircraft %>
<%= form_with url: resolve_aircraft_squawk_path(@aircraft, @squawk), method: :patch, class: "card card-body max-w-3xl space-y-4" do %>
<%= t(".resolve_squawk") %>
<%= @squawk.issue_reported %><%= " · #{@squawk.component}" if @squawk.component %>
<% if @entry.errors.any? %>
<% @entry.errors.full_messages.each do |m| %>- <%= m %>
<% end %>
<% end %>
<% choice = params[:logbook].presence || "new" %>
<%= t(".for_a_new_entry_14") %>
<%= render "shared/sign_as" %>
<%= fields_for :logbook_entry, @entry do |f| %>
<%= f.field :date, as: :date %>
<%= f.field :log_type, as: :select, label: t(".logbook"), collection: LogbookEntry::LOG_TYPES.invert,
data: { component_times_target: "logType", action: "component-times#logTypeChanged" } %>
<%= f.field :aircraft_hours_at_entry, as: :number, step: 0.1, label: t(".airframe_total_time"),
data: { component_times_target: "airframe", action: "input->component-times#airframeChanged" } %>
<%= render "logbook_entries/component_fields", f: f, aircraft: @aircraft %>
<%= f.field :text, as: :textarea, label: t(".work_performed"), rows: 3 %>
<%= f.field :signoff_person, label: t(".signed_off_by"), data: { signer_target: "name" } %>
<%= f.field :signoff_certificate_type, as: :select, label: t(".kind_of_certificate"), include_blank: "—", collection: LogbookEntry::CERTIFICATE_TYPES.invert,
data: { signer_target: "kind" } %>
<%= f.field :signoff_certificate_number, label: t(".certificate_number"), data: { signer_target: "number" } %>
<% end %>
<%= label_tag :resolution_notes, t(".resolution_notes_optional"), class: "label" %>
<%= text_area_tag :resolution_notes, params[:resolution_notes], rows: 2, class: "input" %>
<%= submit_tag t(".resolve"), class: "btn-primary" %><%= link_to t(".cancel"), aircraft_squawks_path(@aircraft), class: "btn-secondary" %>
<% end %>