<%= form_for '', url: templates_upload_path, id: form_id = SecureRandom.uuid, method: :post, class: 'mt-8 block', html: { enctype: 'multipart/form-data' } do %>
  <input type="hidden" name="form_id" value="<%= form_id %>">
  <button type="submit" class="hidden"></button>
  <file-dropzone data-submit-on-upload="true" class="w-full">
    <label for="file_dropzone_input" class="w-full block h-52 relative hover:bg-base-200/30 rounded-xl border-2 border-base-300 border-dashed" data-target="file-dropzone.area">
      <div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center p-2 pointer-events-none">
        <div class="flex flex-col items-center text-center">
          <span data-target="file-dropzone.icon" class="flex flex-col items-center">
            <span>
              <%= svg_icon('cloud_upload', class: 'w-10 h-10') %>
            </span>
            <div class="font-medium mb-1">
              <%= t('upload_new_document') %>
            </div>
            <div class="text-xs">
              <%= t('click_to_upload_or_drag_and_drop_html') %>
            </div>
          </span>
          <span data-target="file-dropzone.loading" class="flex flex-col items-center hidden">
            <%= svg_icon('loader', class: 'w-10 h-10 animate-spin') %>
            <div class="font-medium mb-1">
              <%= t('uploading') %>...
            </div>
          </span>
        </div>
        <input id="file_dropzone_input" name="files[]" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file" accept="image/*, application/pdf<%= ', .docx, .doc, .xlsx, .xls, .odt, .rtf' if Docuseal.multitenant? %>" multiple>
      </div>
    </label>
  </file-dropzone>
<% end %>
