<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button defaultHref="embassy"></ion-back-button>
    </ion-buttons>
    <ion-title (click)="addClick()">Preferences</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content class="ion-padding-top">
  <ion-item-group *ngIf="patch.data['server-info'] as server">
    <ion-item-divider>General</ion-item-divider>
    <ion-item button (click)="presentModalName()">
      <ion-label>Device Name</ion-label>
      <ion-note slot="end">{{ patch.data.ui.name || defaultName }}</ion-note>
    </ion-item>

    <ion-item-divider>Marketplace</ion-item-divider>
    <ion-item
      button
      (click)="serverConfig.presentAlert('auto-check-updates', patch.data.ui['auto-check-updates'] !== false)"
    >
      <ion-label>Auto Check for Updates</ion-label>
      <ion-note slot="end"
        >{{ patch.data.ui['auto-check-updates'] !== false ? 'Enabled' :
        'Disabled' }}</ion-note
      >
    </ion-item>
  </ion-item-group>
</ion-content>
