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

<common:slot.render slot="aboveTitle" context="{ article: article }" />
<common:slot.render slot="aboveTeaserTitle" context="{ article: article }" />

<f:if condition="{article.awardsForList}">
    <ul class="tb-teaser-awards list-reset my-2">
        <f:for each="{article.awardsForList}" as="award">
            <li class="tb-teaser-awards__list-item flex">
                <f:if condition="{award.image}">
                    <f:then>
                        <img
                            src="{award.image}"
                            class="w-16 mr-2 tb-teaser-awards__image"
                            alt="{award.name}"
                        />
                    </f:then>
                    <f:else if="{award.value}">
                        <f:for each="{vh:collection.range(start: 1, end: award.value)}" as="num">
                            <svg class="tb-teaser-awards__icons text-yellow w-4 h-4 mr-1"><use xlink:href="#icon-{award.iconName}"></use></svg>
                        </f:for>
                        <div class="mr-1"></div>
                    </f:else>
                </f:if>
                <span class="tb-awards__text">
                    {award.name}
                </span>
            </li>
        </f:for>
    </ul>
</f:if>

<p class="tb-teaser__topline">
    <strong>{article.categoriesSorted.0.title}</strong>

    <f:if condition="{article.mainAddress.city} || {article.addresses.0.street -> vh:string.notEmpty()}">
        •
        <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
            <f:if condition="{article.mainAddress.city}">
                <span itemprop="addressLocality">{article.mainAddress.city}</span>
            </f:if>
            <f:if condition="{article.addresses.0.street -> vh:string.notEmpty()}">
                <span class="hidden print:block">
                    {article.addresses.0.street}
                </span>
            </f:if>
        </span>
    </f:if>
</p>

<h3 class="tb-teaser__title" itemprop="name">
    {article.name}
</h3>

<common:slot.render slot="belowTitle" context="{ article: article }" />
<common:slot.render slot="belowTeaserTitle" context="{ article: article }" />
