<ion-header class="ion-no-border">
  <div class="header-content pb-20 width-100">
    <div class="header-title width-100">
      <label>Dar o meu parecer</label>
    </div>
  </div>
  <div class="container-div width-100">
    <div class="ion-item-class-2 d-flex">
      <div class="ion-icon-class">
        <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
      </div>
      <div class="ion-input-class-no-height width-100">
        <ion-textarea [(ngModel)]="note" placeholder="Detalhes" rows="6" cols="20"></ion-textarea>
      </div>
    </div>
  </div>
  <div class="ion-item-container-no-border" >
    <ion-label (click)="getDoc()" class="d-flex align-center cursor-pointer">
      <div class="attach-icon d-flex align-center">
        <ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-attach-doc.svg"></ion-icon>
        <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-attach-doc.svg"></ion-icon>
      </div>
      <div class="attach-document pl-10">
        <ion-label>Anexar Documentos</ion-label>
      </div>
    </ion-label>
    <ion-label *ngIf="documents.length > 0">Documentos anexados</ion-label>
  </div>
</ion-header>

<ion-content>
  <div class="main-content d-flex height-100">
    <div class="content-100 d-flex flex-column width-100">
      <div class="overflow-y-auto">
        <div class="list "  *ngFor="let document of documents; let i = index" >
          <ion-list>
            <ion-item>
            <ion-label>
              <p class="d-flex ion-justify-content-between">
                <span class="attach-title-item">{{document.Assunto}}</span>
                <span class="app-name">{{document.appName}}</span>
                <span class="close-button text-black" (click)="removeAttachment(i)" >
                  <ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
                </span>
              </p>
              <p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yyyy HH:mm'}} </span></p>
            </ion-label>
          </ion-item>
          </ion-list>
        </div>
      </div>
    </div>
  </div>
</ion-content>
<ion-footer>
  <div class="buttons">
    <button class="btn-cancel" shape="round" (click)="cancel()">Cancelar</button>
    <button class="btn-ok" shape="round" (click)="save()">Gravar</button>
  </div>
</ion-footer>

