<bit-section [formGroup]="sendOptionsForm" disableMargin>
  @if (anyOptionFieldVisible()) {
    <bit-section-header>
      <h2 class="tw-mt-4" bitTypography="h6">{{ "additionalOptions" | i18n }}</h2>
    </bit-section-header>
    <bit-card>
      @if (maxAccessCountVisible()) {
        <bit-form-field [disableMargin]="!hideEmailVisible() && !privateNoteVisible()">
          <bit-label>{{ "maxAccessCount" | i18n }}</bit-label>
          <input
            bitInput
            type="number"
            step="1"
            min="1"
            formControlName="maxAccessCount"
            [readonly]="!editing()"
            id="send-options_input_max-access-count"
          />
          @if (editing()) {
            <bit-hint>{{ "limitSendViewsHint" | i18n }}</bit-hint>
          }
          @if (showAccessCount()) {
            <bit-hint>&nbsp;{{ "limitSendViewsCount" | i18n: viewsLeft() }}</bit-hint>
          }
        </bit-form-field>
      }
      @if (hideEmailVisible()) {
        <bit-form-control class="tw-flex tw-align-middle" [disableMargin]="!privateNoteVisible()">
          <input bitCheckbox type="checkbox" formControlName="hideEmail" />
          <bit-label>{{ "hideMyEmail" | i18n }}</bit-label>
        </bit-form-control>
      }
      @if (privateNoteVisible()) {
        <bit-form-field disableMargin>
          <bit-label>{{ "privateNote" | i18n }}</bit-label>
          <textarea bitInput rows="3" formControlName="notes" [readonly]="!editing()"></textarea>
        </bit-form-field>
      }
    </bit-card>
  }
</bit-section>
