<ion-header class="ion-no-border">
  <div class="title">
    <div class="thetitle"><ion-label >Expediente</ion-label></div>
    <div class="theicon">
      <button class="btn-no-color" (click)="doRefresh()">
        <ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
      </button>
    </div>
  </div>
</ion-header>
<ion-content>
  <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
      <ion-refresher-content
        pullingIcon="chevron-down-circle-outline"
        pullingText="deslize para actualizar"
        refreshingSpinner="circles"
        refreshingText="A actualizar...">
      </ion-refresher-content>
  </ion-refresher>

  <div class="content width-100 overflow-y-auto height-100" >
    <div >
      <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
      <ion-list *ngIf="expedientegbstore.list.length >=0">
        <div
          class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
          *ngFor = "let task of expedientegbstore.list"
          (click)="goToExpediente(task.SerialNumber)"
        >
          <div class="item width-100">
            <div class="exp-top-detail">
              <div class="subject">
                <ion-label>{{ task.Subject }}</ion-label>
              </div>
              <div class="exp-icon">
                <ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-expediente-attachment.svg"></ion-icon>
                <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-expediente-attachment.svg"></ion-icon>
                <label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
              </div>
            </div>
            <div class="exp-bottom-detail">
              <div class="exp-remetente">
                <ion-label>{{task.Senders}}</ion-label>
              </div>
            </div>
            <div class="exp-middle-detail">
              <div class="exp-workflow">
                <span class="label">{{task.activityInstanceName}}</span>
              </div>
              <div class="exp-date">
                <ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
              </div>
            </div>
          </div>
        </div>
      </ion-list>
    </div>

    <div
      *ngIf="!skeletonLoader && expedientegbstore.list.length == 0 && expedientegbstore.list.length == 0"
      class="empty-list d-flex height-100 align-center justify-content-center"
    >
      <span>Lista vazia</span>
    </div>

    <div *ngIf="skeletonLoader && expedientegbstore.list.length == 0">

      <ion-list>
        <ion-item>
          <ion-thumbnail slot="end">
            <ion-skeleton-text animated></ion-skeleton-text>
          </ion-thumbnail>
          <ion-label>
            <h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
            <p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
            <p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
          </ion-label>
        </ion-item>
        <ion-item>
          <ion-thumbnail slot="end">
            <ion-skeleton-text animated></ion-skeleton-text>
          </ion-thumbnail>
          <ion-label>
            <h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
            <p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
            <p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
          </ion-label>
        </ion-item>
      </ion-list>
    </div>
  </div>

</ion-content>

