{% block collection_media_row %}
    <div class="flex flex-col">
        {% if form.vars.label %}
            {{ form_label(form) }}
        {% endif %}
        {% set errorClass = form.vars.errors|length > 0 ? 'border-red-800 border-2' : null %}
        <div class=" {{ errorClass }}">
            {{ form_errors(form) }}
            <twig:SerenityMedia:FilesForm
                formId="{{ form.vars.id }}"
                border:class="{{ errorClass ? 'border-red-800 border-2':'' }}"
                type="image"
                name="{{ form.vars.full_name }}"
                key="{{ random_string(16) }}"
                dataModel="{{ form.vars.data and form.vars.data|length > 0 ? 'data.files:files uploadedFiles:uploadedFiles' : 'uploadedFiles:uploadedFiles'  }}"
                classForValidateUpload="Serenity\\MediaBundle\\Entity\\Image"
            />
        </div>
        {{ form_help(form) }}
    </div>
{% endblock %}

