{#
    UI Element template
    type: image
    element fields :
        image
        alt
        title
        link
#}
{% if element.image is defined %}
    <section class="block-section block-img">
        {% if element.link is not empty %}
            <a class="img-wrapper" href="{{ element.link }}">
                {{ dedi_sylius_image_optimizer_for_image(element.image, element.alt|default(element.title ?? ''), {
                    'class' : 'img-fluid',
                    'title' : element.title|default('')
                }) }}
            </a>
        {% else %}
            <div class="img-wrapper">
                {{ dedi_sylius_image_optimizer_for_image(element.image, element.alt|default(element.title ?? ''), {
                    'class' : 'img-fluid',
                    'title' : element.title|default('')
                }) }}
            </div>
        {% endif %}
    </section>
{% endif %}
