<% content_for :title, t(".logbook_import", tail_number: @aircraft.tail_number) %> <% if @import.in_progress? %><% content_for :head, tag.meta("http-equiv": "refresh", content: "3") %><% end %> <%= render "shared/aircraft_header", aircraft: @aircraft %>

<%= @import.document&.name || t(".logbook_pages") %>

<%= t("counts.page", count: @import.pages_total) %><%= t(".read_by", model: @import.model) if @import.transcribe && @import.model %>
<% if @import.in_progress? %>
<%= @import.transcribe ? t(".claude_is_reading_the_pages") : t(".saving_pages") %> <%= @import.pages_done %> / <%= @import.pages_total %>

<%= t(".so_far_this_page_updates_html", entry: (t("counts.entry", count: @import.entries_created))) %>

<% elsif @import.done? %>

<%= @import.transcribe ? t(".done_added", entry: (t("counts.logbook_entry", count: @import.entries_created))) : t(".pages_saved") %>

<% if @import.transcribe && @import.entries_created.positive? %>

<%= t(".the_new_entries_are_marked_html", link: (link_to t(".check_them_now"), aircraft_logbook_entries_path(@aircraft, unverified: 1), class: "link")) %>

<% end %> <% else %>

<%= t(".the_import_stopped_html", error: @import.error) %>

<% if @import.entries_created.positive? %>

<%= t(".were_added_before_it_stopped_html", entry: (t("counts.entry", count: @import.entries_created))) %>

<% end %> <% end %>
<%= link_to t(".logbook"), aircraft_logbook_entries_path(@aircraft), class: "btn-secondary btn-sm" %> <% if @import.document %><%= link_to t(".view_scans"), aircraft_document_path(@aircraft, @import.document), class: "btn-secondary btn-sm" %><% end %>
<% if @import.warnings.any? %>

<%= t("counts.note", count: @import.warnings.size) %>

<% end %>