<ion-header>
  <ion-toolbar class="header-toolbar">
    <ion-title>智能体</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true" class="ion-padding" style="background-image: url('../../assets/images/background-image1.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat;">
  <ion-refresher slot="fixed" (ionRefresh)="handleRefresh($event)">
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>
<div>
  @if(user.id == admin){
    <div>
      <h1>我是管理员</h1>
      <ion-card>
        <ion-card-header>
          <ion-card-title>所有人的智能体</ion-card-title>
          <ion-card-subtitle>智能体简介</ion-card-subtitle>
        </ion-card-header>
        <ion-card-content>
          <ion-list>
            <ion-item   *ngFor="let doctor of doctorList1" lines="none">
              <ion-thumbnail slot="start" (click)="openInquiry(doctor)">
                <img [src]="doctor.get('avatar')" [alt]="doctor.get('name')" />
              </ion-thumbnail>
              <div class="doctor-info" (click)="openInquiry(doctor)">
                <p>{{doctor.get("username")}}</p>
                <h3>{{ doctor.get('name') }}({{ doctor.get('age') }}岁)</h3>
                <p>{{ doctor.get('desc') }}</p>
                
              </div>
              <ion-button ios="logo-apple" size="small" color="danger" (click)="deleteAgent(doctor)" slot="end">删除</ion-button>
            </ion-item>
          </ion-list>
        </ion-card-content>
      </ion-card>
    </div>
  }
  <ion-card>
    <ion-card-header>
      <ion-card-title>智能体</ion-card-title>
      <ion-card-subtitle>智能体简介</ion-card-subtitle>
    </ion-card-header>
    <ion-card-content>
      <ion-list>
        <ion-item   *ngFor="let doctor of doctorList" lines="none">
          <ion-thumbnail slot="start" (click)="openInquiry(doctor)">
            <img [src]="doctor.get('avatar')" [alt]="doctor.get('name')" />
          </ion-thumbnail>
          <div class="doctor-info" (click)="openInquiry(doctor)">
            <h3>{{ doctor.get('name') }}({{ doctor.get('age') }}岁)</h3>
            <p>{{ doctor.get('Desc') }},{{ doctor.get('title') }},{{ doctor.get('depart')?.name }}</p>
           
          </div>
          <ion-button ios="logo-apple" size="small" color="danger" (click)="deleteAgent(doctor)" slot="end">删除</ion-button>
        </ion-item>
      </ion-list>
    </ion-card-content>
  </ion-card>
</div>
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
  <ion-fab-button (click)="navigateToPage()">
    <ion-icon name="add"></ion-icon>
  </ion-fab-button>
</ion-fab>
</ion-content>