@using System.Linq @using BankSampahApp.Models @inject BankSampahApp.Services.INotificationService NotificationService @{ var notifications = (await NotificationService.GetNotificationsAsync()) .OrderBy(n => n.IsRead) .ThenByDescending(n => n.CreatedAt) .Take(5) .ToList(); }
@functions { private static string GetSeverityWrapClasses(NotificationSeverity severity) => severity switch { NotificationSeverity.Success => "bg-green-100 text-green-600 rounded size-10 flex items-center justify-center", NotificationSeverity.Warning => "bg-yellow-100 text-yellow-600 rounded size-10 flex items-center justify-center", NotificationSeverity.Error => "bg-red-100 text-red-600 rounded size-10 flex items-center justify-center", _ => "bg-gray-100 text-gray-600 rounded size-10 flex items-center justify-center" }; private static string GetSeverityIcon(NotificationSeverity severity) => severity switch { NotificationSeverity.Success => "check", NotificationSeverity.Warning => "warning", NotificationSeverity.Error => "error", _ => "info" }; private static string GetCategoryLabel(NotificationCategory category) => category switch { NotificationCategory.StatusAkun => "Status Akun", NotificationCategory.Transaksi => "Transaksi", NotificationCategory.Pengajuan => "Pengajuan", _ => category.ToString() }; }