<form (ngSubmit)="formValidated()" [formGroup]="form">

  <div class="input-group">
    <input id="password"
      [attr.type]="showPassword ? 'text' : 'password'" class="form-control"
      formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
      autocomplete="new-password"
    >
    <button class="btn" (click)="togglePasswordVisibility()" type="button">
      @if (showPassword) {
        <ng-container i18n>Hide</ng-container>
      } @else {
        <ng-container i18n>Show</ng-container>
      }
    </button>
  </div>

  <div *ngIf="formErrors.password" class="form-error" role="alert">
    {{ formErrors.password }}
  </div>

  <input class="peertube-button danger-button mt-2" type="submit" value="{{ getFormButtonTitle() }}" [disabled]="!form.valid">
</form>
