@php
$currentRole = strtolower(auth()->user()->idroles ?? '');
$currentRoles = array_filter(array_map('trim', explode(',', $currentRole)));
if (empty($currentRoles)) { $currentRoles = ['guests']; }
$isHeadSView = in_array('head.s', $currentRoles);
$isItstafGuestsView = in_array('itstaf', $currentRoles) && in_array('guests', $currentRoles);
$isItstafHeadSView = in_array('itstaf', $currentRoles) && in_array('head.s', $currentRoles);
$showTabs = $isHeadSView || $isItstafGuestsView || $isItstafHeadSView;
$hasThreeTabs = $has_three_tabs ?? false;
$tabUserLabel = $isItstafHeadSView
? 'Approve IT'
: ($isItstafGuestsView ? 'Approval IT' : 'Approval SPV');
@endphp
@if ($showTabs)
{{-- Tab: Pengajuan Saya --}}
{{-- Tab: Approve IT / IT Staf / Pengajuan User --}}
@if ($hasThreeTabs)
{{-- Tab: Pengajuan User (head.s scope) --}}
@endif
@else
{{-- Tampilan biasa: hanya itstaf atau hanya guests --}}