Files
thankcard-system/resources/views/user/partials/ranking_list.blade.php
T

52 lines
2.2 KiB
PHP

<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)
<x-ranking-item
rank="{{ $item->rank }}"
name="{{ $item->name }}"
team="{{ match((int) $item->departments) {
1 => 'Dev Team',
2 => 'HR Team',
3 => 'Sale Team',
4 => 'Board Team',
5 => 'Marketing Team',
default => 'Team'
} }}"
avatar="{{ $item->avatar ?? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode($item->name) . '&backgroundColor=bfdbfe' }}"
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 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>
<x-ranking-item
rank="{{ $currentUserRankItem->rank > 0 ? $currentUserRankItem->rank : '-' }}"
name="{{ $currentUserRankItem->name }}"
team="{{ match((int) $currentUserRankItem->departments) {
1 => 'Dev Team',
2 => 'HR Team',
3 => 'Sale Team',
4 => 'Board Team',
5 => 'Marketing Team',
default => 'Team'
} }}"
avatar="{{ $currentUserRankItem->avatar ?? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode($currentUserRankItem->name) . '&backgroundColor=bfdbfe' }}"
score="{{ $currentUserRankItem->score }}"
unit="thẻ"
:isCurrent="true"
/>
</div>
@endif
</div>