{namespace neos=Neos\Neos\ViewHelpers}
{namespace vh=Newland\NeosViewHelpers\ViewHelpers}
{namespace poi=Newland\Toubiz\Poi\Neos\ViewHelpers}
{namespace search=Newland\Toubiz\Search\Neos\ViewHelpers}

<f:alias map="{article: searchResult.originalObject}">
    <li class="tb-search-result-list__item">
        <poi:link.article article="{article}" currentNode="{node}" class="tb-search-result-list__link">
            <article>
                <header>
                    <h3 class="tb-search-result-list__title">
                        <f:format.raw>
                            <search:format.text text="{article.name}" searchQuery="{searchQuery}" />
                        </f:format.raw>
                    </h3>
                </header>

                <div class="tb-search-result-list__content">
                    <div>
                        <p>
                            <f:format.raw>
                                <search:format.text
                                    text="{article.abstract}"
                                    searchQuery="{searchQuery}"
                                    maxCharacters="240"
                                    append="…" />
                            </f:format.raw>
                        </p>
                    </div>

                    <f:if condition="{article.mediaSorted.0}">
                        <div class="tb-search-result-list__image-wrapper">
                            <img src="{article.mediaSorted.0.sourceUri}"
                                alt="{article.mediaSorted.0.title}"
                                class="block" />
                        </div>
                    </f:if>
                </div>
            </article>
        </poi:link.article>
    </li>
</f:alias>
