@php $currentFilter = $currentFilter ?? 'current'; @endphp @if(empty($courses))

@if($currentFilter === 'current') No Current Courses Found @elseif($currentFilter === 'completed') No Completed Courses Yet @else No Courses Allocated @endif

@if($currentFilter === 'current') All courses are completed or no active courses are allocated to your batch yet. @elseif($currentFilter === 'completed') No courses have been marked completed yet. @else There are no courses allocated for your batch. @endif

@else
@foreach($courses as $course) @php $percentage = max(0, min(100, (float) ($course['percentage'] ?? 0))); $roundPct = (int) round($percentage); $starsLit = $roundPct >= 85 ? 3 : ($roundPct >= 65 ? 2 : ($roundPct >= 30 ? 1 : 0)); $stateCls = $roundPct >= 75 ? 'is-great' : ($roundPct >= 50 ? 'is-warn' : ''); $barWidth = $roundPct > 0 ? max(8, $roundPct) : 4; $img = trim((string) ($course['image'] ?? '')); if ($img !== '' && (str_starts_with($img, 'images/') || str_starts_with($img, 'storage/'))) { $imgUrl = asset($img); } elseif ($img !== '') { $imgUrl = asset('images/' . $img); } else { $imgUrl = ''; } $langText = !empty($course['language']) ? strtoupper((string) $course['language']) : 'CODING'; $searchBlob = strtolower(trim(($course['name'] ?? '') . ' ' . ($course['language'] ?? ''))); @endphp
@csrf
{{-- Illustrated Stage Banner --}}
{{ $course['total_hours'] ?? 0 }} Hours
{{-- Floating Language Medallion --}}
@if($imgUrl !== '') {{ $langText }} @else @endif
{{ $langText }}

{{ $course['name'] ?? 'Unnamed Course' }}

Attendance {{ $roundPct }}%
See My Stamps!
@endforeach
@endif