{namespace vh=Newland\NeosViewHelpers\ViewHelpers}

<f:if condition="{article.awardsForList}">
    <ul class="tb-teaser-awards flex flex-wrap gap-2 list-reset my-2">
        <f:for
            each="{article.awardsForList}"
            as="award"
            iteration="i"
        >
            <f:if condition="{i.cycle} <= 4">
                <li
                    title="{award.name}"
                    class="tb-teaser-awards__list-item flex items-center"
                >
                    <f:if condition="{award.image}">
                        <f:then>
                            <img
                                src="{award.image}"
                                class="w-16 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>
                        </f:else>
                    </f:if>
                </li>
            </f:if>
        </f:for>
    </ul>
</f:if>
