Files

33 lines
907 B
PHP
Raw Permalink Normal View History

2026-07-31 17:41:55 +03:00
@props([
'title' => null,
'products' => [],
2026-08-26 13:43:30 +03:00
'cols' => 4,
2026-07-31 17:41:55 +03:00
])
2026-08-26 13:43:30 +03:00
@php
$gridCols = match((int) $cols) {
3 => 'grid-cols-2 md:grid-cols-3',
2 => 'grid-cols-1 md:grid-cols-2',
default => 'grid-cols-2 md:grid-cols-4',
};
@endphp
2026-07-31 17:41:55 +03:00
<section {{ $attributes }}>
@if($title)
<h2 class="font-display font-extrabold text-h2 mb-10">{{ $title }}</h2>
@endif
<div class="grid {{ $gridCols }} gap-9">
2026-07-31 17:41:55 +03:00
@foreach($products as $product)
<x-ui.product-card
:name="$product['name']"
:price="$product['price'] ?? null"
:image="$product['image'] ?? null"
:href="$product['href'] ?? '#'"
:variant-id="$product['variantId'] ?? null"
2026-09-23 17:53:23 +03:00
:has-custom-fields="$product['hasCustomFields'] ?? false"
2026-07-31 17:41:55 +03:00
/>
@endforeach
</div>
</section>