<div class="flex-1 flex flex-col justify-between min-h-[340px]">
    @if(count($rankers) > 0)
        <div class="flex flex-col">
            @foreach($rankers as $item)
                @php
                    $teamName = $item->department_name ?? 'Team';
                @endphp
                <x-ranking-item 
                    rank="{{ $item->rank }}" 
                    name="{{ $item->name }}" 
                    team="{{ $teamName }}" 
                    avatar="{{ $item->avatar ? $item->avatar : asset('images/avatar.png') }}" 
                    score="{{ $item->score }}" 
                    unit="thẻ" 
                    :isCurrent="$item->msnv == Auth::user()->msnv" 
                />
            @endforeach
        </div>
    @else
        <div class="flex-1 flex flex-col justify-center items-center py-6 text-center">
            <span class="text-[36px]">🏆</span>
            <p class="text-gray-400 font-medium text-[13px] mt-2">Chưa có xếp hạng cho tháng này</p>
        </div>
    @endif

    @if($currentUserRankItem)
        <div class="mt-auto">
            <div class="my-3 border-t border-dashed border-gray-100 mx-2"></div>
            @php
                $currTeamName = $currentUserRankItem->department_name ?? 'Team';
            @endphp
            <x-ranking-item 
                rank="{{ $currentUserRankItem->rank > 0 ? $currentUserRankItem->rank : '-' }}" 
                name="{{ $currentUserRankItem->name }}" 
                team="{{ $currTeamName }}" 
                avatar="{{ $currentUserRankItem->avatar ? $currentUserRankItem->avatar : asset('images/avatar.png') }}" 
                score="{{ $currentUserRankItem->score }}" 
                unit="thẻ" 
                :isCurrent="true" 
            />
        </div>
    @endif
</div>
