@php
$iconMap = [
'campaign' => ['bg' => 'bg-wa-mint', 'fg' => 'text-wa-deep', 'svg' => ''],
'broadcast' => ['bg' => 'bg-wa-mint', 'fg' => 'text-wa-deep', 'svg' => ''],
'webhook' => ['bg' => 'bg-[#E8F5E9]', 'fg' => 'text-wa-deep', 'svg' => ''],
'chat' => [
'bg' => 'bg-[#D9E5F2]',
'fg' => 'text-[#13478A]',
'svg' =>
'',
],
'mention' => [
'bg' => 'bg-[#D9E5F2]',
'fg' => 'text-[#13478A]',
'svg' => '',
],
'system' => [
'bg' => 'bg-accent-amber/20',
'fg' => 'text-[#7B5A14]',
'svg' => '',
],
'billing' => [
'bg' => 'bg-accent-amber/20',
'fg' => 'text-[#7B5A14]',
'svg' => '',
],
'device' => [
'bg' => 'bg-[#F3E9FF]',
'fg' => 'text-[#5B3D8A]',
'svg' => '',
],
'template' => [
'bg' => 'bg-wa-mint',
'fg' => 'text-wa-deep',
'svg' => '',
],
'contact' => [
'bg' => 'bg-[#E8F5E9]',
'fg' => 'text-wa-deep',
'svg' => '',
],
];
$catBadgeMap = [
'campaign' => ['bg-wa-mint', 'text-wa-deep'],
'broadcast' => ['bg-wa-mint', 'text-wa-deep'],
'webhook' => ['bg-[#E8F5E9]', 'text-wa-deep'],
'chat' => ['bg-paper-50', 'text-ink-700'],
'mention' => ['bg-[#D9E5F2]', 'text-[#13478A]'],
'system' => ['bg-accent-amber/20', 'text-[#7B5A14]'],
'billing' => ['bg-accent-amber/20', 'text-[#7B5A14]'],
'device' => ['bg-[#F3E9FF]', 'text-[#5B3D8A]'],
'template' => ['bg-wa-mint', 'text-wa-deep'],
'contact' => ['bg-[#E8F5E9]', 'text-wa-deep'],
];
@endphp
@forelse ($grouped as $label => $items)
{{ $label }}
@foreach ($items as $n)
@php
$icon = $iconMap[$n->category] ?? $iconMap['system'];
$cat = $catBadgeMap[$n->category] ?? $catBadgeMap['system'];
$unread = (bool) $n->status;
$title = $n->notification_title ?? '';
$msg = $n->notification_msg ?? '';
@endphp
-
@if ($unread)
@endif
{{ $title }}
{{ strtoupper($n->category) }}
@if ($n->is_urgent)
{{ __('URGENT') }}
@endif
@if ($n->verb)
{{ strtoupper($n->verb) }}
@endif
{{ $msg }}
{{ $n->created_at->format('H:i') }}/{{ $n->created_at->diffForHumans() }}
@if ($n->action_url)
View
@endif
@if ($unread)
@endif
@endforeach
@empty
@include('user.partials.empty-state', [
'class' => 'm-4',
'message' =>
'No notifications match the current filters. Notifications appear here when campaigns, broadcasts, webhooks, or devices need attention.',
'resetHref' => url('/notifications'),
'actionHref' => url('/settings?tab=notifications'),
'actionLabel' => 'Preferences',
])
@endforelse