@if($application)
@foreach($application->stepper as $index => $step) @php $isCompleted = $step['completed']; $isRejected = $step['rejected'] ?? false; $isCurrent = !$isCompleted && !$isRejected && collect($application->stepper) ->take($index) ->every(fn($s) => $s['completed']); @endphp
{{-- ========================================================= STEP CIRCLE ========================================================== --}}
{{-- ===================================================== ICONS ====================================================== --}} {{-- APPLIED --}} @if($index === 0) {{-- FINAL --}} @elseif($step['final']) @if(in_array($step['final_status'], [ 'intern-offered', 'job-offered', 'ppo' ])) @elseif($step['final_status'] === 'not-selected') @else ● @endif {{-- REJECTED --}} @elseif($isRejected) {{-- COMPLETED --}} @elseif($isCompleted) {{-- CURRENT --}} @elseif($isCurrent) {{-- PENDING --}} @else ● @endif
{{-- ========================================================= LABEL ========================================================== --}} {{ $step['label'] }} {{-- ========================================================= DATE ========================================================== --}} @if($step['date']) {{ $step['date'] }} @endif {{-- ========================================================= REJECTED MESSAGE ========================================================== --}} @if($isRejected) @if($step['slug'] === '1st-shortlist') Not Shortlisted @elseif($step['slug'] === '2nd-shortlist') Not Shortlisted @elseif($step['slug'] === 'interview') Not Selected @endif @endif {{-- ========================================================= FINAL RESULT TEXT ========================================================== --}} @if($step['final'] && $step['completed']) {{ in_array($step['final_status'], [ 'intern-offered', 'job-offered', 'ppo' ]) ? 'Selected' : 'Position Closed' }} @endif
{{-- ============================================================= CONNECTOR LINE ============================================================== --}} @if(!$loop->last) @php $nextStep = $application->stepper[$index + 1] ?? null; $lineCompleted = ($isCompleted || $isRejected) && ( ($nextStep['completed'] ?? false) || ($nextStep['rejected'] ?? false) ); @endphp
@endif @endforeach
@else
{{ $emptyMessage }}
@endif