{namespace vh=Newland\NeosViewHelpers\ViewHelpers}
{namespace common=Newland\Toubiz\Common\Neos\ViewHelpers}

<common:slot.render slot="aboveImage" context="{ article: article }" />
<common:slot.render slot="aboveTeaserImage" context="{ article: article }" />
<f:if condition="{article.mainMedium}">
    <f:then>
        <div class="tb-teaser__image-wrapper">
            <img
                data-src="{article.mainMedium.previewUri}"
                alt="{article.mainMedium.title}"
                class="tb-teaser__image lazyload"
                itemprop="image url" />

            <vh:render section="badge" arguments="{ article: article }" />
            <common:slot.render slot="onImage" context="{ article: article }" />
            <common:slot.render slot="onTeaserImage" context="{ 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 }" />
            <common:slot.render slot="onImage" context="{ article: article }" />
            <common:slot.render slot="onTeaserImage" context="{ article: article }" />
        </div>
    </f:else>
</f:if>
<common:slot.render slot="belowImage" context="{ article: article }" />
<common:slot.render slot="belowTeaserImage" context="{ article: article }" />

<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>
