<form [formGroup]="sendAccessForm" (ngSubmit)="onSubmit()">
  @if (error()) {
    <div class="tw-text-main tw-text-center">
      <p bitTypography="body1">{{ "unexpectedErrorSend" | i18n }}</p>
    </div>
  }
  @if (unavailable()) {
    <div class="tw-text-main tw-text-center">
      <p bitTypography="body1">{{ "sendAccessUnavailable" | i18n }}</p>
    </div>
  } @else {
    @switch (sendAuthType()) {
      @case (authType.Password) {
        <app-send-access-password
          [loading]="loading()"
          [formGroup]="sendAccessForm"
        ></app-send-access-password>
      }
      @case (authType.Email) {
        <app-send-access-email
          [formGroup]="sendAccessForm"
          [enterOtp]="enterOtp()"
          [loading]="loading()"
          (resendCode)="onResendCode()"
          (backToEmail)="onBackToEmail()"
        ></app-send-access-email>
      }
    }
  }
</form>
