<div class="dam-grid__items">
  {% if items is empty %}
    <div class="dam-grid__empty">
      <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
        <rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
        <circle cx="8.5" cy="8.5" r="1.5"/>
        <polyline points="21 15 16 10 5 21"/>
      </svg>
      <p>No media items found</p>
    </div>
  {% else %}
    {% for item in items %}
      {% include '@nodehive_dam/nodehive-dam-grid-item.html.twig' with {'item': item} %}
    {% endfor %}
  {% endif %}
</div>

{% if has_more %}
  <div class="dam-grid__load-more">
    <button
      type="button"
      class="dam-grid__load-more-btn button"
      hx-get="/nodehive/admin/dam/grid?page={{ next_page }}{% if current_params.search %}&search={{ current_params.search }}{% endif %}{% if current_params.type %}&type={{ current_params.type }}{% endif %}{% if current_params.date_from %}&date_from={{ current_params.date_from }}{% endif %}{% if current_params.date_to %}&date_to={{ current_params.date_to }}{% endif %}"
      hx-target="#dam-grid"
      hx-swap="innerHTML"
    >
      Load more
    </button>
  </div>
{% endif %}
