feat: product badges and show page layout
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
029689407b
commit
9920fafab6
@@ -0,0 +1,15 @@
|
||||
@props(['product'])
|
||||
|
||||
@php
|
||||
$ticked = collect(\App\Models\Product::BADGES)->filter(fn ($label, $key) => $product->{$key});
|
||||
@endphp
|
||||
|
||||
@if($ticked->isNotEmpty())
|
||||
<div class="flex flex-wrap items-center gap-1.5">
|
||||
@foreach($ticked as $key => $label)
|
||||
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-primary-100 dark:bg-primary-900 text-primary-800 dark:text-primary-200">
|
||||
{{ $label }}
|
||||
</span>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
@@ -37,6 +37,11 @@
|
||||
{{ Str::limit($product->description, 100) }}
|
||||
</p>
|
||||
|
||||
<!-- Badges -->
|
||||
<div class="mb-3 empty:hidden">
|
||||
<x-product.badges :product="$product" />
|
||||
</div>
|
||||
|
||||
<!-- Meta Information -->
|
||||
<div class="flex items-center justify-between text-xs text-gray-500 dark:text-gray-400">
|
||||
<div class="flex items-center space-x-3">
|
||||
|
||||
Reference in New Issue
Block a user