@extends('layouts.app') @php $title = 'Leaderboard - ' . config('app.name'); $pill = fn (bool $active) => $active ? 'bg-primary-600 text-white border-primary-600' : 'bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700'; $tabClass = fn (bool $active) => $active ? 'border-primary-500 text-gray-900 dark:text-white' : 'border-transparent text-gray-500 dark:text-gray-400 hover:border-gray-300 dark:hover:border-gray-600 hover:text-gray-700 dark:hover:text-gray-200'; $periodLabel = ['today' => 'today', 'week' => 'this week', 'month' => 'this month'][$period] ?? null; @endphp @section('content')

Leaderboard

The most upvoted and the newest products from European makers.

Top New
@if($tab === 'top')
@foreach($periods as $key => $label) {{ $label }} @endforeach
@endif @if($products->isEmpty())
@if($tab === 'new')

No products yet.

@else

No upvotes yet {{ $periodLabel ?? 'at all' }}

Try a longer period.

@endif
@else
    @foreach($products as $product)
  1. {{ $products->firstItem() + $loop->index }} @if($product->thumbnail_url) {{ $product->title }} @else
    {{ strtoupper(substr($product->title, 0, 1)) }}
    @endif
    {{ $product->title }}

    {{ Str::limit($product->description, 100) }}

    @foreach($product->tags->take(3) as $tag) #{{ $tag->name }} @endforeach
    @include('components.product.upvote-button', ['product' => $product, 'size' => 'md']) @if($tab === 'top' && $periodLabel)

    {{ $product->period_upvotes_count }} {{ $periodLabel }}

    @endif
  2. @endforeach
{{ $products->links() }}
@endif
@endsection