{% block component_line_item_image %}
    {% set thumbnail %}
        {% if lineItem.cover.url and lineItem.cover.isSpatialObject() == false %}
            {% block component_line_item_image_thumbnails %}
                {% sw_thumbnails 'line-item-img-thumbnails' with {
                    media: lineItem.cover,
                    sizes: {
                        'default': '100px'
                    },
                    attributes: {
                        'class': 'img-fluid line-item-img',
                        'alt': (lineItem.cover.translated.alt ?: ''),
                        'title': (lineItem.cover.translated.title ?: ''),
                        'loading': 'lazy'
                    }
                } %}
            {% endblock %}
        {% else %}
            {% if fallbackIcon %}
                {% block component_line_item_image_fallback_icon %}
                    <div class="line-item-img line-item-icon">
                        {% sw_include '@Storefront/storefront/utilities/icon.html.twig' with {
                            name: fallbackIcon
                        } %}
                    </div>
                {% endblock %}
            {% else %}
                {% block component_line_item_image_placeholder %}
                    {% sw_include '@Storefront/storefront/utilities/icon.html.twig' with {
                        name: 'placeholder',
                        size: 'fluid'
                    } %}
                {% endblock %}
            {% endif %}
        {% endif %}
    {% endset %}

    {# @deprecated tag:v6.6.0 - Boolean variable productLink will be removed, use lineItemLink and lineItemModalLink instead and pass the desired url as string. Remove this if block. #}
    {% if productLink and not lineItemLink %}
        {% set lineItemLink = seoUrl('frontend.detail.page', { 'productId': lineItem.referencedId }) %}

        {% if controllerAction is same as('confirmPage') %}
            {% set lineItemModalLink = path('widgets.quickview.minimal', { 'productId': lineItem.referencedId }) %}
        {% endif %}
    {% endif %}

    {% if lineItemLink %}
        <a href="{{ lineItemLink }}"
           class="line-item-img-link"
           title="{{ label }}"
            {% if lineItemModalLink %}
                data-ajax-modal="modal"
                data-modal-class="quickview-modal"
                data-url="{{ lineItemModalLink }}"
            {% endif %}
        >
            {{ thumbnail }}
        </a>
    {% else %}
        {{ thumbnail }}
    {% endif %}
{% endblock %}
