2026-10-17 16:24:26 +03:00
|
|
|
<div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 hover:shadow-lg transition-shadow overflow-hidden group">
|
2026-02-14 16:11:09 +02:00
|
|
|
<a href="{{ route('products.show', $product) }}" class="block">
|
|
|
|
|
<!-- Thumbnail -->
|
2026-10-17 16:24:26 +03:00
|
|
|
<div class="relative aspect-video bg-gray-100 dark:bg-gray-700 overflow-hidden">
|
2026-02-14 16:11:09 +02:00
|
|
|
@if($product->thumbnail_url)
|
|
|
|
|
<img src="{{ $product->thumbnail_url }}"
|
|
|
|
|
alt="{{ $product->title }}"
|
|
|
|
|
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300">
|
|
|
|
|
@else
|
|
|
|
|
<div class="w-full h-full flex items-center justify-center bg-gradient-to-br from-primary-100 to-primary-200">
|
|
|
|
|
<svg class="h-16 w-16 text-primary-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<!-- Category Badge -->
|
|
|
|
|
<div class="absolute top-2 left-2">
|
2026-10-17 16:24:26 +03:00
|
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-white/90 backdrop-blur-sm text-gray-800 dark:text-gray-200">
|
2026-02-14 16:11:09 +02:00
|
|
|
{{ $product->category->name }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Content -->
|
|
|
|
|
<div class="p-4">
|
2026-10-17 16:24:26 +03:00
|
|
|
<h3 class="text-lg font-semibold text-gray-900 dark:text-white line-clamp-1 group-hover:text-primary-600">
|
2026-02-14 16:11:09 +02:00
|
|
|
{{ $product->title }}
|
|
|
|
|
</h3>
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400 line-clamp-2">
|
2026-02-14 16:11:09 +02:00
|
|
|
{{ $product->description }}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<!-- Meta Info -->
|
|
|
|
|
<div class="mt-4 flex items-center justify-between">
|
|
|
|
|
<div class="flex items-center space-x-3">
|
|
|
|
|
<!-- Upvote Button -->
|
|
|
|
|
<form action="{{ route('products.upvote', $product) }}" method="POST" class="inline-block" @auth @else onclick="event.preventDefault(); alert('Please login to upvote');" @endauth>
|
|
|
|
|
@csrf
|
|
|
|
|
<button type="submit"
|
|
|
|
|
@guest disabled @endguest
|
2026-10-17 16:24:26 +03:00
|
|
|
class="group/upvote flex items-center space-x-1 px-3 py-1.5 rounded-md border {{ $product->isUpvotedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 dark:bg-primary-900 text-primary-700' : 'border-gray-300 bg-white text-gray-700 dark:text-gray-300 hover:border-primary-500 hover:bg-primary-50' }} transition-colors">
|
2026-02-14 16:11:09 +02:00
|
|
|
<svg class="h-4 w-4" fill="{{ $product->isUpvotedBy(auth()->user()) ? 'currentColor' : 'none' }}" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="text-sm font-medium">{{ $product->upvotes_count }}</span>
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<!-- Comments Count -->
|
2026-10-17 16:24:26 +03:00
|
|
|
<div class="flex items-center space-x-1 text-gray-500 dark:text-gray-400">
|
2026-02-14 16:11:09 +02:00
|
|
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
<span class="text-sm">{{ $product->comments_count }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- User Info -->
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
<a href="{{ route('profile.show', $product->user) }}" class="flex items-center space-x-2 hover:opacity-75" onclick="event.stopPropagation();">
|
|
|
|
|
<div class="h-6 w-6 rounded-full bg-gradient-to-br from-primary-500 to-accent-500 flex items-center justify-center text-white text-xs font-semibold">
|
|
|
|
|
{{ strtoupper(substr($product->user->name, 0, 1)) }}
|
|
|
|
|
</div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<span class="text-xs text-gray-600 dark:text-gray-400">{{ $product->user->name }}</span>
|
2026-02-14 16:11:09 +02:00
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|