<form [formGroup]="settings" class="tw-container">
  @if (displayDomain) {
    <bit-form-field>
      <bit-label>{{ "forwarderDomainName" | i18n }}</bit-label>
      <input
        bitInput
        formControlName="domain"
        type="text"
        placeholder="example.com"
        (change)="save('domain')"
      />
      <bit-hint>{{ "forwarderDomainNameHint" | i18n }}</bit-hint>
    </bit-form-field>
  }
  @if (displayToken) {
    <bit-form-field>
      <bit-label>{{ "apiKey" | i18n }}</bit-label>
      <input bitInput formControlName="token" type="password" (change)="save('password')" />
      <button
        type="button"
        bitIconButton
        bitSuffix
        bitPasswordInputToggle
        (change)="save('token')"
      ></button>
    </bit-form-field>
  }
  @if (displayPrefix) {
    <bit-form-control>
      <input bitCheckbox type="checkbox" formControlName="prefix" (change)="save('prefix')" />
      <bit-label>{{ "forwarderWebsitePrefix" | i18n }}</bit-label>
      <bit-hint>{{ "forwarderWebsitePrefixHint" | i18n }}</bit-hint>
    </bit-form-control>
  }
  @if (displayBaseUrl) {
    <bit-form-field disableMargin>
      <bit-label>{{ "selfHostBaseUrl" | i18n }}</bit-label>
      <input bitInput formControlName="baseUrl" type="text" (change)="save('baseUrl')" />
    </bit-form-field>
  }
</form>
