{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

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

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

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

<f:section name="badge">
    <f:if condition="{article.flatAttributes.labels.top}">
        <div class="tb-badge">
            <vh:translate 
                id="property.attribute.labels.top"
                package="Newland.Toubiz.Poi.Neos"
                source="Views/Teaser" />
                
        </div>
    </f:if>
</f:section>
