<%= form_for '', url: '', id: form_id = SecureRandom.uuid, method: :post, class: 'hidden', data: { target: 'dashboard-dropzone.form' }, html: { enctype: 'multipart/form-data' } do %>
<% end %>
<%= render 'templates/dashboard_dropzone', style: 'height: 137px' %>
<% unless @template_folder.parent_folder %>
<%= render 'templates/dashboard_folder_dropzone', style: 'height: 137px' %>
<% end %>
<%= svg_icon('folder', class: 'w-9 h-9 flex-shrink-0') %>
<%= @template_folder.name %>
<% if can?(:update, @template_folder) && @template_folder.full_name != TemplateFolder::DEFAULT_NAME %>
<%= svg_icon('pencil', class: 'w-7 h-7') %>
<% end %>
<% if params[:q].present? || @pagy.pages > 1 || @template_folders.present? %>
<%= render 'shared/search_input' %>
<% end %>
<% if can?(:create, ::Template) %>
<%= render 'templates/upload_button', folder_name: @template_folder.full_name %>
<%= link_to new_template_path(folder_name: @template_folder.full_name), class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %>
<%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %>
<%= t('create') %>
<% end %>
<% end %>
<% if @template_folders.present? %>
<%= render partial: 'template_folders/folder', collection: @template_folders, as: :folder %>
<% end %>
<% if @pagy.count.nil? || @pagy.count > 0 %>
<%= t('templates_not_found') %>
<% if @related_submissions.present? %>
<%= render partial: 'templates/submission', collection: @related_submissions, locals: { with_template: true } %>
<%= render 'shared/pagination', pagy: @related_submissions_pagy, items_name: 'submissions', next_page_path: submissions_path(q: params[:q], folder: @template_folder.full_name) %>
<% end %>
<% end %>