{% extends "@core/views/_views-view-withwrapper.html.twig" %}

{% block view_rows %}

  {# Views Rows #}
  {% set cards = [] %}

  {% for item in items %}

    {% set card %}

      {% embed "@molecules/tm-cards/modern-card/modern-card.twig" %}
        {# FIELDS #}
        {% set img_url = item.img_url %}
        {% set img_alt = item.img_alt %}
        {% set title = item.title %}
        {% set card_link = item.card_link %}
        {% set tags = item.tags %}
      {% endembed %}

    {% endset %}

    {% set cards = cards|merge([card]) %}

  {% endfor %}

  {# Pass the cards array and the rows scaffolding. #}
  <div class="view-content views-infinite-scroll-content-wrapper clearfix" data-drupal-views-infinite-scroll-content-wrapper>
    {% include "@organisms/tm-scaffold/rows-cols/rows-cols.twig" with {
      'batch': 3,
      'items': cards,
      'auto_height': true,
      'row_class': 'mb-0 light-brd',
      'col_class': 'mb-4 col-md-4',
    } only %}
  </div>

{% endblock %}
