% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
<% with_filters = @pagy.pages > 1 || params[:q].present? || filter_params.present? %>
<%= render 'templates/title', template: @template %>
<%= link_to template_path(@template), class: 'flex items-center' do %>
<%= svg_icon('chevron_left', class: 'w-5 h-5') %>
<%= t('back_to_active') %>
<% end %>
<%= t('submissions') %> <%= t('archived') %>
<% if with_filters %>
<%= render 'shared/search_input' %>
<% end %>
<%= link_to new_template_submissions_export_path(@template), class: 'btn btn-ghost text-base', data: { turbo_frame: 'modal' } do %>
<%= svg_icon('download', class: 'w-6 h-6 stroke-2') %>
<%= t('export') %>
<% end %>
<% if with_filters %>
<%= render 'submissions_filters/applied_filters', filter_params: %>
<%= render 'submissions_filters/filter_button', filter_params: %>
<% end %>
<% if @pagy.count.nil? || @pagy.count > 0 %>
<%= render partial: 'templates/submission', collection: @submissions, locals: { template: @template, archived: true } %>
<% elsif params[:q].present? || filter_params.present? %>
<%= t('submissions_not_found') %>
<% end %>
<%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions' %>