1 <ng-template #notificationItemTemplate
2 let-notification="notification"
4 <div class="notification-wrapper">
5 <div class="notification-item">
6 <div class="notification-icon">
7 <cd-icon [type]="notificationIconMap[notification.type] || notificationIconMap['default']">
10 <div class="notification-content">
11 <div class="notification-timestamp">{{ notification.timestamp | relativeDate }}</div>
12 <div class="notification-title">{{ notification.title }}</div>
13 <div class="notification-message"
14 [innerHTML]="notification.message | sanitizeHtml"></div>
16 <button cdsButton="ghost"
18 class="notification-close"
19 (click)="removeNotification(notification, $event)">
20 <cd-icon type="destroy"></cd-icon>
24 <div class="notification-divider"></div>
29 @if (todayNotifications.length > 0) {
30 <div class="notification-section-heading"
32 @for (notification of todayNotifications; track notification.timestamp; let last = $last) {
33 <ng-container *ngTemplateOutlet="notificationItemTemplate; context: { notification: notification, last: last }"></ng-container>
37 @if (previousNotifications.length > 0) {
38 <div class="notification-section-heading"
40 @for (notification of previousNotifications; track notification.timestamp; let last = $last) {
41 <ng-container *ngTemplateOutlet="notificationItemTemplate; context: { notification: notification, last: last }"></ng-container>
45 @if (todayNotifications.length === 0 && previousNotifications.length === 0) {
46 <div class="notification-empty">
47 <div i18n>No notifications</div>