1 <!-- Reusable notification item template -->
2 <ng-template #notificationItemTemplate
3 let-notification="notification"
5 <div class="notification-wrapper">
6 <div class="notification-item">
7 <div class="notification-icon">
8 <cd-icon [type]="notificationIconMap[notification.type] || 'info'">
11 <div class="notification-content">
12 <div class="notification-timestamp">{{ notification.timestamp | relativeDate }}</div>
13 <div class="notification-title">{{ notification.title }}</div>
14 <div class="notification-message"
15 [innerHTML]="notification.message | sanitizeHtml"></div>
17 <button cdsButton="ghost"
19 class="notification-close"
20 (click)="removeNotification(notification, $event)">
21 <cd-icon type="destroy"></cd-icon>
25 <div class="notification-divider"></div>
30 @if (todayNotifications.length > 0) {
31 <div class="notification-section-heading"
33 @for (notification of todayNotifications; track notification.timestamp; let last = $last) {
34 <ng-container *ngTemplateOutlet="notificationItemTemplate; context: { notification: notification, last: last }"></ng-container>
38 @if (previousNotifications.length > 0) {
39 <div class="notification-section-heading"
41 @for (notification of previousNotifications; track notification.timestamp; let last = $last) {
42 <ng-container *ngTemplateOutlet="notificationItemTemplate; context: { notification: notification, last: last }"></ng-container>
46 @if (todayNotifications.length === 0 && previousNotifications.length === 0) {
47 <div class="notification-empty">
48 <div i18n>No notifications</div>