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

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

<%= t(".upload_a_sam_zip_archive_html") %> <%= t(".everything_in_it_is_added") %>

<% if @preview %>
<%= t(".archive_html", tail_number: @preview.tail_number, make_model: ([ @preview.make, @preview.model ].compact_blank.join(" "))) %> <% if @preview.exported_at %><%= t(".exported_html", to_date: (fmt_date(@preview.exported_at.to_date))) %><% end %>
<% end %> <%= form_with url: aircraft_imports_path, multipart: true, class: "space-y-4" do |f| %>
<%= f.label :archive, t(".archive_sam_zip"), class: "label" %> <%= f.file_field :archive, accept: ".zip,application/zip", required: true, class: "block text-sm text-slate-600 file:mr-3 file:rounded-md file:border-0 file:bg-slate-100 file:px-3 file:py-1.5 file:text-sm file:font-medium hover:file:bg-slate-200" %> <% if @conflict %>

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

<% end %>
<%= f.label :tail_number, t(".tail_number"), class: "label" %> <%= f.text_field :tail_number, value: (params[:tail_number] unless @conflict), class: "input uppercase", placeholder: @preview&.tail_number || t(".from_the_archive"), required: @conflict.present? %>

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

<%= f.submit t(".import"), class: "btn-primary" %><%= link_to t(".cancel"), root_path, class: "btn-secondary" %>
<% end %>