{{-- Mobile Header Component Expects: - $title: Page title (optional, defaults to greeting) - $showBackButton: Boolean to show back button (optional, defaults to false) - $backUrl: URL for back button (optional, defaults to dashboard) - $showNotifications: Boolean to show notifications (optional, defaults to true) - $showDarkMode: Boolean to show dark mode toggle (optional, defaults to true) - $financeUser: User object for profile info --}} @php $title = $title ?? null; $showBackButton = $showBackButton ?? false; $backUrl = $backUrl ?? route('dashboard'); $showNotifications = $showNotifications ?? true; $showDarkMode = $showDarkMode ?? true; @endphp
@if($showBackButton) @else Profile @endif
@if($title)

{{ $title }}

@else

{{ explode(' ', $financeUser->name)[0] }} {{ Auth::user()->lastname }}

@endif
@if($showDarkMode) @endif @if($showNotifications)
@php $mobileUnreadCount = Auth::user()->notifications()->where('is_read', false)->count(); @endphp @if($mobileUnreadCount > 0) {{ $mobileUnreadCount > 9 ? '9+' : $mobileUnreadCount }} @endif
@endif
@if($showNotifications)

Notifications

@php $mobileUnreadNotifications = Auth::user()->notifications()->where('is_read', false)->count(); @endphp @if($mobileUnreadNotifications > 0)

{{ $mobileUnreadNotifications }} new notification{{ $mobileUnreadNotifications > 1 ? 's' : '' }}

@else

All caught up!

@endif
@php $mobileNotifications = Auth::user()->notifications()->latest()->take(8)->get(); @endphp @forelse($mobileNotifications as $notification)
@php $mobileIconClass = 'fa-solid fa-bell'; $mobileColorClass = 'primary'; switch($notification->type) { case 'success': $mobileIconClass = 'fa-solid fa-check-circle'; $mobileColorClass = 'green'; break; case 'warning': $mobileIconClass = 'fa-solid fa-exclamation-triangle'; $mobileColorClass = 'yellow'; break; case 'danger': $mobileIconClass = 'fa-solid fa-exclamation-circle'; $mobileColorClass = 'red'; break; case 'info': default: $mobileIconClass = 'fa-solid fa-info-circle'; $mobileColorClass = 'blue'; break; } @endphp

{{ $notification->title ?? 'Notification' }}

{{ $notification->message ?? 'You have a new notification.' }}

@if(!$notification->is_read)
@endif

{{ $notification->created_at->diffForHumans() }}

@if(!$notification->is_read) New @endif
@empty

No notifications yet

We'll notify you when something happens

@endforelse
@if($mobileNotifications->count() > 0)
View All
@endif
@endif