<h1>Notifications</h1>
<div *ngIf="!notificationPage; else content">
    No data
</div>
<ng-template #content>
    <div class="ui-g-12" dir="rtl">
        <button type="button" label="Mark all as read" pButton class="ui-button-width-fit" (click)="onMarkAllAsRead()"></button>
    </div>
    <div>왜 이 div가 없으면 위에 버튼이 안눌릴까요 ㅠㅠ 한참 헤맸자농ㅠㅠ </div>
    <p-table [value]="notificationPage.content" selectionMode="single"  (onRowSelect)="onRowSelect($event)" >
        <ng-template pTemplate="header">
            <tr>
                <th style="width:9em">Date</th>
                <th style="width:12em">Title</th>
                <th pResizableColumn>Message</th>
                <th style="width:8em">User</th>
            </tr>
        </ng-template>
        <ng-template pTemplate="body" let-notification let-rowIndex="rowIndex" >
          <tr [pSelectableRow]="notification" [ngStyle]="notification.confirmDate ? '' : {'background-color': 'lightblue'}">
              <td>{{notification.createDate | date: 'dd/MM/yyyy'}}</td>
              <td>{{notification.title}}</td>
              <td>{{notification.message}}</td>
              <td>{{notification.member.name}}</td>
          </tr>
      </ng-template>
    </p-table>
    <p-paginator #paginator [rows]="notificationPage.size" [totalRecords]="notificationPage.totalElements"
     (onPageChange)="onPaginate($event)" [first]="2"></p-paginator>
    
</ng-template>
