{# Variables in this template:

    data_controller="one two three" | optional

    field_class_name | optional
    field_input_name
    field_label
    errors

#}

{% if field_required is not defined -%}
{% set field_required=false -%}
{%- endif -%}

<sdoc-form-row
  {% if data_controller is defined -%}
      data-controller="{{ data_controller }}"
  {%- endif -%}
>
  <sdoc-form-row-main>

    {%- if errors|length > 0 -%}
      {%- for error in errors -%}
      <sdoc-form-error>
        {{ error }}
      </sdoc-form-error>
      {%- endfor -%}
    {%- endif -%}

    <sdoc-form-field {% if field_required %}required{% endif %}>
        <label for="{{ field_input_name }}">
          {{ field_label|default('Choose a file', true) }}{% if field_required %} *{% endif %}
        </label>
        <input
          {% if field_required %}required{% endif %}
          type="file"
          name="{{ field_input_name }}"
          id="{{ field_input_name }}"
          data-testid="form-{{ field_input_name }}-field"
        />
    </sdoc-form-field>

  </sdoc-form-row-main>
</sdoc-form-row>
