This commit is contained in:
28
resources/views/partials/product-carousel.blade.php
Normal file
28
resources/views/partials/product-carousel.blade.php
Normal file
@@ -0,0 +1,28 @@
|
||||
@php
|
||||
$items = $products ?? collect();
|
||||
@endphp
|
||||
|
||||
<section class="pc-section">
|
||||
<div class="pc-section-title">
|
||||
<h2>{{ $title ?? 'Товары' }}</h2>
|
||||
@if (!empty($description))
|
||||
<p>{{ $description }}</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if ($items->isEmpty())
|
||||
<div class="pc-card">{{ $emptyText ?? 'Пока нет товаров.' }}</div>
|
||||
@else
|
||||
<div class="pc-product-carousel" data-product-carousel>
|
||||
<button class="pc-product-carousel-btn is-prev" type="button" data-product-carousel-prev aria-label="Предыдущие товары">‹</button>
|
||||
<div class="pc-product-carousel-track" data-product-carousel-track>
|
||||
@foreach ($items as $product)
|
||||
<div class="pc-product-carousel-item">
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="pc-product-carousel-btn is-next" type="button" data-product-carousel-next aria-label="Следующие товары">›</button>
|
||||
</div>
|
||||
@endif
|
||||
</section>
|
||||
Reference in New Issue
Block a user