<ion-header>
  <ion-toolbar>
    <ion-title>遗产继承人</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content class="inheritors">
  <div style="margin-top: 15px;">
  <ion-toolbar >
    <ion-searchbar [(ngModel)]="searchText" placeholder="搜索联系人"></ion-searchbar>
    <ion-buttons slot="end">
      <ion-button (click)="openMessages()" color="medium">
        <ion-icon name="mail"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
  </div>

  <ion-card *ngFor="let contact of filterContacts()" class="custom-card">
    <ion-card-header>
      <ion-card-subtitle (click)="goContact()">继承人姓名</ion-card-subtitle>
      <ion-card-title>{{ contact.name }}</ion-card-title>
    </ion-card-header>
    <ion-card-content>
      <ion-list>
        <ion-item  style="background-color: var(--custom-background-color);">
          <ion-label>继承人电话</ion-label>
          <ion-text color="dark">{{ contact.phone }}</ion-text>
        </ion-item>
        <ion-item>
          <ion-label>继承人邮箱</ion-label>
          <ion-text color="dark">{{ contact.email }}</ion-text>
        </ion-item>
      </ion-list>
    </ion-card-content>
  </ion-card>

  <!-- 添加新继承人按钮 -->
  <ion-button expand="block" color="medium" (click)="add()">添加新继承人</ion-button>
</ion-content>