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


<events:link.eventDate
    date="{eventDate}"
    currentNode="{targetNode}"
    class="tb-teaser"
>
    <common:slot.render slot="aboveListItem" context="{ eventDate: eventDate }" />
    <vh:render section="content" arguments="{_all}" />
    <common:slot.render slot="belowListItem" context="{ eventDate: eventDate }" />
</events:link.eventDate>

<f:section name="content">
    <vh:render partial="EventDates/Teaser/Common/Image" arguments="{_all}"/>

    <div class="tb-teaser__text">
        <vh:render partial="EventDates/Teaser/Common/Topline" arguments="{_all}"/>

        <h3 class="tb-teaser__title" itemprop="name">
            {eventDate.event.title}
        </h3>

        <f:if condition="{eventDate.event.location.name}">
            <strong itemprop="name">
                {eventDate.event.location.name}
            </strong>
        </f:if>

        <div class="mt-2 {f:if(condition: eventDate.cancelled, then: 'line-through', else: '')}">
            <vh:render partial="EventDates/Time" arguments="{eventDate: eventDate, prefix: '', suffix: ''}" />
        </div>
        <f:if condition="{eventDate.cancelled}">
            <p class="text-negative-500 font-bold">
                {f:translate(id: 'property.cancelled', package: 'Newland.Toubiz.Events.Neos', source: 'Models/Event')}
            </p>
        </f:if>
    </div>
</f:section>
