Notifikasi

@php $notifications = $notifications ?? collect(); @endphp
@if($notifications->where('is_read', false)->count() > 0)
@csrf
@endif
@forelse($notifications as $notif) @php $isOrder = in_array($notif->type, ['order', 'pesanan']) || str_contains(strtolower($notif->title), 'pesanan') || str_contains(strtolower($notif->title), 'order'); $icon = 'info'; $bgColor = 'bg-primary/10 text-primary'; $targetUrl = route('order-bid-mitra'); if ($isOrder) { $icon = 'notifications_active'; $bgColor = 'bg-primary text-white'; } elseif ($notif->type === 'promo') { $icon = 'sell'; $bgColor = 'bg-amber-100 text-amber-800'; } elseif ($notif->type === 'transaction') { $icon = 'account_balance_wallet'; $bgColor = 'bg-emerald-100 text-emerald-800'; } elseif ($notif->type === 'system') { $icon = 'campaign'; $bgColor = 'bg-surface-container-highest text-on-surface'; } @endphp
@if(!$notif->is_read)
@endif
{{ $icon }}

{{ $notif->title }}

{{ $notif->message }}

{{ is_object($notif->created_at) && method_exists($notif->created_at, 'diffForHumans') ? $notif->created_at->diffForHumans() : 'Baru saja' }} @if($isOrder) Buka Pesanan chevron_right @else Ketuk untuk detail @endif
@empty
notifications_off

Belum ada notifikasi

Notifikasi pesanan dan info terbaru akan muncul di sini.

@endforelse
@include('partials.bottom-nav-mitra')