<div{{ attributes.defaults(stimulus_controller('discover_media_results')) }} class="flex flex-col">
    <div class="grid grid-cols-1 md:grid-cols-6 gap-4">
        {% for i in range(0, media|length - 1) %}
            {% if i > 5 and tease is true %}
                {% set class_list = "hidden" %}
            {% else %}
                {% set class_list = "" %}
            {% endif %}

            {% set poster = media[i] %}
            <twig:Poster data-discover-media-results-target="poster"
                         imdbId="{{ poster.imdbId }}"
                         tmdbId="{{ poster.tmdbId }}"
                         title="{{ poster.title }}"
                         description="{{ poster.description }}"
                         image="{{ poster.poster }}"
                         year="{{ poster.year }}"
                         mediaType="movies"
                         class="pb-2 w-full rounded-lg {{ class_list }}"
            />
        {% endfor %}
    </div>

    {% if tease == true %}
    <div class="inline-flex self-end text-white">
        <button data-discover-media-results-target="moreBtn" data-action="click->discover-media-results#moreResults" href="#" class="underline">More</button>
        <a data-discover-media-results-target="moreLink" href="{{ url('app.discover.browse', {mediaType: mediaType, page: 2, genreId: genreId}) }}" class="underline hidden">More &gt;</a>
    </div>
    {% endif %}
</div>
