{% set entriesDelvery = [] %}
{% set countEntries = 0 %}

{% if (component.entries|length) > 0 %}
	{% set countEntries = component.entries.count() %}
	{% if countEntries > 0 %}
		{% set entriesDelvery = component.entries.all() %}
	{% endif %}
{% else %}
	{% set countEntries =
    craft.entries().section('galleriesOfDeliveries').limit(12).count()
  %}
	{% if countEntries > 0 %}
		{% set entriesDelvery =
      craft.entries().section('galleriesOfDeliveries').limit(12).all()
    %}
	{% endif %}
{% endif %}

<article data-dg-57543 class="py-5 deliveryGallery bg-{{ index.index0 }}" id="{{ id }}">
	<section class="container deliveryGallery py-3">
		<h2 class="deliveryGallery__title">
			{{ component.titleDelivery }}
		</h2>

		{% include 'components/_sliderCard' with {
      array: entriesDelvery,
      lengthArray: countEntries
    } %}

		<div class="col-12 col-md-3 mx-auto">
			{% include 'components/_btnArrow' with {
        btn: component.linkSection
      } only %}
		</div>
	</section>
</article>
