@if($notifications->where('is_read', false)->count() > 0)
@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
@empty
{{ $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
notifications_off
@endforelse
Belum ada notifikasi
Notifikasi pesanan dan info terbaru akan muncul di sini.