<% is_last_save = @node.path_ids.include?(last_save_node&.id) %>

<div class="stage-header-container">

  <ol class="stage-progress" role="progressbar">
    <% n_stages.times do |i| %>
      <%= tag.li class: ("done" if is_last_save or stage_index >= (i + 1)) %>
    <% end %>    
  </ol>
  
  <div class="stage-header">    
    <div class="stage-icon"><%= svg (is_last_save ? t("icons.last_save") : t("icons.stages")[stage_index]) %></div>
    <div>
      <%= tag.div t("game.stage_i_of_n", i: (is_last_save ? n_stages : stage_index), n: n_stages), class: "stage-progress" %>
      <%= tag.h1 @node.title %>
    </div>
  </div>
</div>