{#
/**
 * @file
 * Default theme implementation for an ONLYOFFICE form file upload element.
 *
 * Available variables:
 * - attributes: HTML attributes for the containing element.
 * - has_file: Flag indicating whether a file has been uploaded.
 * - file: Information about the uploaded file, including:
 *   - id: The file ID.
 *   - name: The file name.
 * - description: The field description.
 * - element: The original form element.
 * - module_path: The path to the module directory.
 *
 * @see template_preprocess_onlyoffice_form_file_upload()
 *
 * @ingroup themeable
 */
#}
<div{{ attributes.addClass('onlyoffice-form-file-upload-wrapper') }}>
  <div class="onlyoffice-form-upload-field-wrapper">
    {% if has_file %}
      <div class="onlyoffice-form-uploaded-file">
        <div class="onlyoffice-form-file-preview">
          <img src="{{ module_path }}/images/pdf.svg" alt="PDF File" width="96" height="96">
          <div class="onlyoffice-form-file-info">
            <div class="onlyoffice-form-file-title">Title: {{ file.name }}</div>
          </div>
        </div>
        <button type="button" class="onlyoffice-form-remove-button button">Remove</button>
      </div>
    {% else %}
      <div class="onlyoffice-form-upload-container">
        <button type="button" class="onlyoffice-form-upload-button button">Select file</button>
      </div>
    {% endif %}
  </div>
  
  {# Keep the hidden input for the file ID #}
  <input type="hidden" name="upload_file[fids]" value="{{ file.id|default('') }}" class="form-file" />
</div>
