<admin-page-header [title]="'Under Maintenance'"></admin-page-header>

<!-- Edit Maintenance Page -->
<div class="col-xl-12 col-lg-12 col-md-12">
  <div class="card ">
    <div class="card-header border-0">
      <h4 class="card-title">{{'Under maintenance Page' | translate}}</h4>
    </div>
    <form #maintenanceData="ngForm" (ngSubmit)="maintenance(maintenanceData, 'maintencance')">
      <div class="card-body">
        <div class="form-group">
          <label class="form-label">{{'Main Title' | translate}} <span class="text-red">*</span></label>
          <input required type="text" class="form-control" [ngModel]="underMaint?.['503title']" name="503title">
        </div>
        <div class="form-group">
          <label class="form-label">{{'Title' | translate}}<span class="text-red">*</span></label>
          <input required type="text" class="form-control" [ngModel]="underMaint?.['503subtitle']"
            name="503subtitle">
        </div>
        <div class="form-group">
          <label class="form-label">{{'Subtitle' | translate}}</label>
          <textarea class="form-control" [placeholder]="'Enter text here' | translate" name="503description"
            [ngModel]="underMaint?.['503description']" id="answer"></textarea>
        </div>
        <div class="form-group">
          <label class="form-label">{{'Redirection URL' | translate}}</label>
          <input type="url" class="form-control" [placeholder]="'Enter Redirection URL' | translate" name="redirectionURL"
            [ngModel]="underMaint?.['redirectionURL']" id="redirectionURL" />
        </div>
        <div class="form-group">
          <label class="form-label">{{'Enable Maintenance Mode' | translate}}</label>
          <a class="onoffswitch2">
            <input type="checkbox" name="MAINTENANCE_MODE" id="maintanance_mode_enable"
              class=" toggle-class onoffswitch2-checkbox sprukoregister"
              [checked]="underMaint?.MAINTENANCE_MODE == 'on' ? true : false"
              [ngModel]="underMaint?.MAINTENANCE_MODE == 'on' ? true : false"
              [value]="underMaint?.MAINTENANCE_MODE == 'on' ? true : false">
            <label for="maintanance_mode_enable" class="toggle-class onoffswitch2-label"></label>
          </a>
        </div>
      </div>
      <div class="card-footer">
        <div class="form-group float-end ">
          <button type="submit" [disabled]="maintenanceData.invalid || sendingResponse['maintencance']"
            class="btn btn-secondary">{{'Save Changes' | translate}}
            @if (sendingResponse['maintencance']) {
            <i class="fa fa-spinner fa-spin mx-1"></i>
            }
          </button>
        </div>
      </div>
    </form>
  </div>
</div>
<!-- End Edit Maintenance Page -->