<form [formGroup]="formGroup" [bitSubmit]="submit" *ngIf="!loading; else spinner">
  <div class="tw-w-2/5">
    <p class="tw-mt-8" *ngIf="!loading">
      {{ "projectMachineAccountsDescription" | i18n }}
    </p>
    <sm-access-policy-selector
      [loading]="loading"
      formControlName="accessPolicies"
      [addButtonMode]="true"
      [items]="items"
      [label]="'machineAccounts' | i18n"
      [hint]="'projectMachineAccountsSelectHint' | i18n"
      [columnTitle]="'machineAccounts' | i18n"
      [emptyMessage]="'projectEmptyMachineAccountAccessPolicies' | i18n"
    >
    </sm-access-policy-selector>
    <button bitButton buttonType="primary" bitFormButton type="submit" class="tw-mt-7">
      {{ "save" | i18n }}
    </button>
  </div>
</form>

<ng-template #spinner>
  <div class="tw-items-center tw-justify-center tw-pt-64 tw-text-center">
    <i class="bwi bwi-spinner bwi-spin bwi-3x"></i>
  </div>
</ng-template>
