<div *ngIf="error" class="alert alert-danger">{{ error }}</div>

<form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form">

  <div class="form-group">
    <label i18n for="user-name">User name</label>
    <input
      type="text" id="user-name" class="form-control"
      formControlName="user-name"
    >
    <div class="text-muted" i18n>
      People can find you @{{ user.username }}@{{ instanceHost }}
    </div>
  </div>

  <div class="form-group">
    <label i18n for="display-name">Display name</label>
    <input
      type="text" id="display-name" class="form-control"
      formControlName="display-name" [ngClass]="{ 'input-error': formErrors['display-name'] }"
    >
    <div *ngIf="formErrors['display-name']" class="form-error">
      {{ formErrors['display-name'] }}
    </div>
  </div>

  <div class="form-group">
    <label i18n for="description">Description</label>
    <textarea
      id="description" formControlName="description" class="form-control"
      [ngClass]="{ 'input-error': formErrors['description'] }"
    ></textarea>
    <div *ngIf="formErrors.description" class="form-error">
      {{ formErrors.description }}
    </div>
  </div>

  <input type="submit" i18n-value value="Save" [disabled]="!form.valid">
</form>
