{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<f:if condition="{article.mainMedium}">
    <f:then>
        <div class="tb-teaser__image-wrapper">
            <img
                data-src="{article.mainMedium.sourceUri}"
                alt="{article.mainMedium.title}"
                class="tb-teaser__image lazyload"
                itemprop="image url" />

            <vh:render section="badge" arguments="{ article: article }" />
        </div>
    </f:then>
    <f:else>
        <div class="tb-teaser__image-wrapper">
            <div class="tb-teaser__image-fallback">
                <svg class="c-icon">
                    <use xlink:href="#icon-image"></use>
                </svg>
            </div>

            <vh:render section="badge" arguments="{ article: article }" />
        </div>
    </f:else>
</f:if>

<f:section name="badge">
    <f:if condition="{article.flatAttributes.labels.top}">
        <span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
            <meta itemprop="name" content="label" />
            <div class="tb-badge" itemprop="value">
                <vh:translate
                    id="property.attribute.labels.top"
                    package="Newland.Toubiz.Poi.Neos"
                    source="Views/Teaser" />

            </div>
        </span>
    </f:if>
</f:section>
