@php
$u = auth()->user();
$firstName = $u ? trim(explode(' ', $u->name)[0] ?? $u->name) : '';
$unreadCount = $notificationCount ?? 0;
$quickFunctionAccentMap = [
'card' => 'indigo',
'deposit' => 'emerald',
'history' => 'sky',
'withdraw' => 'rose',
'exchange' => 'amber',
'p2p_trading' => 'violet',
'list-2' => 'slate',
'add' => 'teal',
'wallet' => 'cyan',
'send-money' => 'blue',
'request-money' => 'green',
'mobile-recharge' => 'teal',
'voucher' => 'orange',
'referrals' => 'pink',
'support' => 'cyan',
'merchant' => 'purple',
'sidebar-agent' => 'violet',
'linked' => 'fuchsia',
'qrcode' => 'zinc',
'layer' => 'indigo',
'trending-up' => 'emerald',
];
$quickFunctionTitleMap = [
'card' => __('My Cards'),
'deposit' => __('Add Money'),
'history' => __('Transaction History'),
'send-money' => __('Send Money'),
'request-money' => __('Request Money'),
'linked' => __('Payment Links'),
'sidebar-agent' => __('Agent Services'),
'list-2' => __('My Ads'),
'support' => __('Support Ticket'),
'layer' => __('Subscriptions'),
'trending-up' => __('Wallet Earn'),
];
$quickFunctionOrder = [
'wallet' => 10,
'send-money' => 20,
'request-money' => 30,
'deposit' => 40,
'withdraw' => 50,
'history' => 60,
'sidebar-agent' => 70,
'linked' => 80,
'mobile-recharge' => 90,
'exchange' => 100,
'card' => 110,
'voucher' => 120,
'referrals' => 130,
'p2p_trading' => 135,
'list-2' => 140,
'layer' => 150,
'trending-up' => 160,
'support' => 170,
'merchant' => 180,
'add' => 190,
];
$quickFunctionLinks = array_values(array_merge($quickLinksMain ?? [], $quickLinksMore ?? []));
usort($quickFunctionLinks, fn (array $left, array $right): int => ($quickFunctionOrder[$left['icon']] ?? 999) <=> ($quickFunctionOrder[$right['icon']] ?? 999));
try {
$quickFunctionDefaultWallet = $u?->default_wallet;
} catch (\Throwable) {
$quickFunctionDefaultWallet = null;
}
$quickFunctionDefaultCurrency = $quickFunctionDefaultWallet?->currency;
$quickFunctionDefaultSymbol = $quickFunctionDefaultCurrency?->symbol ?? siteCurrency('symbol');
$quickFunctionDefaultCode = $quickFunctionDefaultCurrency?->code ?? siteCurrency();
$quickFunctionDefaultBalance = $quickFunctionDefaultWallet
? $quickFunctionDefaultSymbol.' '.number_format((float) $quickFunctionDefaultWallet->balance,siteDecimalPlaces())
: __('No wallet yet');
@endphp
{{-- ==========================================================
| Mobile Sticky App Header (visible < 992px only)
| Sits ABOVE dev's legacy _mobile_navbar (which CSS hides on mobile).
========================================================== --}}
@else
{{ $u ? mb_strtoupper(mb_substr($u->name, 0, 1)) : 'U' }}
@endif