{% set entrySummary =
  module(
    'V2_Entry_Summary',
    moduleId,
    {
      bid: null,
      cid: null,
      eid: null,
      uid: null,
      page: null,
      limit: null,
      keyword: null,
      tag: [],
      field: null,
      order: null,
      start: '1000-01-01 00:00:00',
      end: '9999-12-31 23:59:59'
    }
  )
%}

{% if entrySummary.items is not empty %}
  <div>
    {{ include('/admin/module/setting.twig', { moduleInfo: entrySummary.moduleInfo }) }}
    <div class="{{ wrapper_class|default('grid grid-cols-1 md:grid-cols-2 lg:grid-cols-1 gap-4') }}">
      {% for entry in entrySummary.items %}
        <article>
          <a href="{{ entry.url }}" class="flex items-start gap-2 hover:opacity-70">
            <div class="w-1/3 aspect-square overflow-hidden rounded-md">
              {% if entry.mainImage.path %}
                <img
                  src="{{ entry.mainImage.path|resizeImg(192, 192) }}"
                  width="96"
                  height="96"
                  alt="{{ entry.mainImage.alt }}"
                  loading="lazy"
                  decoding="async"
                  class="object-cover w-full h-full"
                />
              {% else %}
                <img
                  src="/images/default/noimage.gif"
                  alt=""
                  width="96"
                  height="96"
                  loading="lazy"
                  decoding="async"
                  class="object-cover w-full h-full"
                />
              {% endif %}
            </div>
            <div class="flex flex-col items-start justify-center w-2/3 text-sm">
              <h3 class="text-gray-900 font-bold line-clamp-3">{{ entry.title }}</h3>
              <div class="flex items-center mt-1">
                <p class="text-gray-500">
                  <time datetime="{{ entry.datetime|date('Y-m-d') }}">{{ entry.datetime|date('Y年m月d日') }}</time>
                </p>
                {% if entry.isNew %}
                  <p class="ml-2 px-2 py-1 rounded-full bg-gray-50 text-gray-900 text-xs">
                    NEW
                  </p>
                {% endif %}
              </div>
            </div>
          </a>
        </article>
      {% endfor %}
    </div>
  </div>
{% endif %}
