<admin-page-header [title]="'Projects Import'" ></admin-page-header>

<!-- Project Import Csv-->
<div class="col-xl-12 col-lg-12 col-md-12">
  <div class="card ">

    @if (Error) {
      <div class="alert alert-danger">
        <p>{{ErrorMessage}}</p>
      </div>
    }

    <div class="card-header border-0">
      <h4 class="card-title">{{'Import Projects' | translate}}</h4>
    </div>
    <form #FormData="ngForm" (ngSubmit)="UploadProjects(FormData, 'uploadprojects')">
      <div class="card-body">
        <div class="row">
          <div class="form-group">
            <label class="form-label">{{'Upload File' | translate}} </label>
            <div class="input-group file-browser">
              <input #uploadFile ngModel class="form-control" (change)="File($event)" name="file" type="file">
            </div>
            <small class="text-muted"><i>{{'File Format: .xlsx and .csv' | translate}}</i></small>
            <p>{{'Download' | translate}} <a href="./download/projectsample.csv" class="text-primary"
            download>{{'Sample File'| translate}}</a></p>
          </div>
        </div>
      </div>
      <div class="card-footer">
        <button type="submit" [disabled]="sendingResponse['uploadprojects']" class="btn btn-secondary float-end mb-2"> {{'Import Data' | translate}}@if (sendingResponse['uploadprojects']) {
          <i class="fa fa-spinner fa-spin mx-1"></i>
        }</button>
      </div>
    </form>
  </div>
</div>
<!-- Project Import Csv -->