@php $data = $notification->data ?? []; $title = 'Pemberitahuan'; $iconClass = 'fas fa-bell text-warning'; if (str_contains($notification->type, 'WargaRegisteredNotification')) { $title = 'Registrasi Warga'; $iconClass = 'fas fa-user-check text-success'; } elseif (str_contains($notification->type, 'SuratSubmittedNotification')) { $title = 'Pengajuan Surat'; $iconClass = 'fas fa-paper-plane text-primary'; } elseif (str_contains($notification->type, 'SuratApprovedNotification')) { $title = 'Pengajuan Disetujui'; $iconClass = 'fas fa-check-circle text-success'; } elseif (str_contains($notification->type, 'SuratRejectedNotification')) { $title = 'Pengajuan Ditolak'; $iconClass = 'fas fa-times-circle text-danger'; } elseif (str_contains($notification->type, 'SuratScanUploadedNotification')) { $title = 'Dokumen Siap'; $iconClass = 'fas fa-file-download text-info'; } elseif (str_contains($notification->type, 'SuratNeedRevisionNotification')) { $title = 'Revisi Berkas'; $iconClass = 'fas fa-exclamation-circle text-warning'; } // Fallback to custom payload icons/titles if defined if (isset($data['icon'])) { $iconClass = $data['icon']; } if (isset($data['title'])) { $title = $data['title']; } $isUnread = is_null($notification->read_at); $bgClass = $isUnread ? 'bg-light' : ''; @endphp
{{ $data['message'] ?? '' }}