Kembali ke Pencarian

Top 3 Rekomendasi Pakaian

Temukan 3 pakaian terbaik yang sesuai dengan preferensi Anda

@if (isset($message) || (isset($recommendations) && $recommendations->isEmpty()) || (isset($rekomendasi) && $rekomendasi->isEmpty()))
{{ $message ?? 'Tidak ada pakaian yang cocok dengan preferensi Anda.' }}

Coba ubah kriteria pencarian atau pilih opsi yang lebih fleksibel.

@else @php // Support both variable names for backward compatibility $results = $recommendations ?? $rekomendasi ?? collect([]); // Limit to top 3 recommendations $top3Results = $results->take(3); @endphp
Menampilkan 3 pakaian terbaik dari {{ $results->count() }} hasil yang ditemukan
@foreach ($top3Results as $index => $item) @php $rank = $index + 1; $clothing = $item['pakaian']; $score = $item['score']; $clothingType = $item['jenis_pakaian'] ?? 'Lainnya'; // Calculate star rating based on score (0-1 scale to 0-5 stars) $maxScore = $results->max('score'); $normalizedScore = $maxScore > 0 ? ($score / $maxScore) * 5 : 0; $fullStars = floor($normalizedScore); $hasHalfStar = ($normalizedScore - $fullStars) >= 0.5; @endphp
{{ $rank }}
@if ($rank == 1)
Pilihan Terbaik
@else
Top {{ $rank }}
@endif @if ($clothing->img && file_exists(public_path('storage/' . $clothing->img))) Gambar {{ $clothing->nama_pakaian ?? $clothing->nama }} @else
@endif
{{ $clothingType }}
{{ $clothing->nama_pakaian ?? $clothing->nama }}
Rp {{ number_format($clothing->harga ?? 0, 0, ',', '.') }}
@if (isset($clothing->merek))
{{ $clothing->merek }}
@endif @if (isset($clothing->ukuran))
Ukuran: {{ $clothing->ukuran }}
@endif
Skor Kecocokan
{{ number_format($score, 3) }}
@for ($i = 1; $i <= 5; $i++) @if ($i <= $fullStars) @elseif ($i == $fullStars + 1 && $hasHalfStar) @else @endif @endfor
@endforeach
@endif