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

{% set link_scope = "card" %}
{% set block_class = "bl-vf cbelianr nh" %}
{% set header_tag = "h2" %}
{% set image_fluid = true %}
{% set order = "bwd" %}
{% set layout = "hoz" %}
{% set right_icon = "fas fa-chevron-right" %}
{% set subtitle_display = "flex" %}
{% set batch_size = 2 %}

{% set batch_size = batch_size|default(2) %}

{% block view_header %}{% endblock %}

{% 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.image_src %}
        {% set img_alt = item.image_alt %}
        {% set title = item.title %}
        {% set date = item.subtitle ? (item.subtitle|date('d/m/Y')) : '' %}
        {% set card_link = item.block_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': batch_size,
      'items': cards,
      'auto_height': false,
      'row_class': 'light-brd',
      'col_class': 'mb-4 col-sm-12 col-lg-6',
    } only %}
  </div>

{% endblock %}
