<ion-header class="ion-no-border">
  <div class="main-header">
    <div class="title-content">
    <!--   <div class="back-icon" (click)="goBack()">
        <ion-icon  slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
      </div> -->
      <div *ngIf="item" class="div-title width-100 flex-grow-1">
        <div class="title">
          <ion-label>{{item.Description}}</ion-label>
        </div>

        <div class="actions-icon">
          <!--  <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
          <button class="btn-no-color" (click)="openEditPublication(item.ProcessId)">
            <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
            <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
          </button>
          <button class="btn-no-color" (click)="deletePublication(item.ProcessId)">
            <ion-icon class="delete"  src='assets/images/theme/gov/icons-delete.svg'></ion-icon>
          </button>
          <button class="btn-no-color cursor-pointer" (click)="doRefresh($event)">
           <ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon>
          </button >
         </div>
      </div>
      <div class="div-body width-100">
        <p class="item-content-detail">{{item.Detail}}</p>
        <p class="item-content-date">{{ item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p>
      </div>

    </div>
  </div>
</ion-header>

<ion-content>
  <ion-refresher  name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
    <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
    <ion-refresher-content>
    </ion-refresher-content>
  </ion-refresher>
  <div class="main-container px-20">
    <ion-list>
      <!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
      <div class="post-item  d-md-block mb-10 cursor-pointer"
        *ngFor="let publication of publicationListStorage.documents[folderId]"
        (click)="viewPublicationDetail(publication.DocumentId)">
        <div *ngIf="publication.FileBase64.length > 30" class="mb-10 post-img width-md-100">
          <img src="{{publication.FileBase64}}" alt="image">
        </div>
        <div *ngIf="publication.FileBase64.length < 30" class="mb-10 post-img">
          <img src="/assets/icon/icon-no-image.svg" alt="image">
        </div>
        <div class="post-content px-20 width-md-100 ">
          <div class="post-title-time">
            <div class="post-title">
              <ion-label>{{publication.Title}}</ion-label>
            </div>
            <div class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | HH:mm'}}</div>
          </div>
          <div class="post-description">
            <p>{{publication.Message}}</p>
          </div>
        </div>

      </div>
      <div class="center height-100" *ngIf="!publicationList">
        <p>{{error}}</p>
      </div>
    </ion-list>
  </div>
  <!-- fab placed to the bottom end -->
  <ion-fab vertical="bottom" horizontal="end">
    <ion-fab-button (click)="AddPublication('2',item.ProcessId)">
      <ion-icon name="add"></ion-icon>
    </ion-fab-button>
  </ion-fab>
</ion-content>
