<?php if (mb_strlen($q) < 2): ?>
<?php elseif (!$products && !$categories): ?>
<p class="border-t border-zinc-100 py-8 text-sm text-zinc-500">"<?= e($q) ?>" için sonuç bulunamadı.</p>
<?php else: ?>
<div class="grid gap-8 border-t border-zinc-100 py-8 lg:grid-cols-[200px_1fr]">
<?php if ($categories): ?>
<div>
<p class="eyebrow">Kategoriler</p>
<ul class="mt-4 space-y-2 text-sm">
<?php foreach ($categories as $category): ?>
<li><a href="<?= category_url($category) ?>" class="font-medium text-zinc-700 hover:text-ink"><?= e($category['name']) ?></a></li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>
<div class="<?= $categories ? '' : 'lg:col-span-2' ?>">
<p class="eyebrow">Ürünler</p>
<div class="mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-3">
<?php foreach ($products as $product): ?>
<a href="<?= product_url($product) ?>" class="flex items-center gap-4 rounded-2xl p-2 transition hover:bg-zinc-50">
<span class="h-16 w-14 shrink-0 overflow-hidden rounded-xl bg-zinc-100"><?= product_image($product, 'h-full w-full object-cover', 'text-xl') ?></span>
<span class="min-w-0">
<span class="block truncate text-sm font-medium text-ink"><?= e($product['name']) ?></span>
<span class="mt-1 block text-sm <?= discount_rate($product) ? 'text-accent-600' : 'text-zinc-600' ?>"><?= money($product['price']) ?></span>
</span>
</a>
<?php endforeach ?>
</div>
<a href="<?= e(url('arama?q=' . urlencode($q))) ?>" class="mt-5 inline-flex items-center gap-1.5 text-sm font-semibold text-ink hover:underline">"<?= e($q) ?>" için tüm sonuçlar<?= icon('arrow', 'size-4', '2') ?></a>
</div>
</div>
<?php endif ?>
Lisans bilgisi projenin LICENSE dosyasında.