<form [formGroup]="folderForm" [bitSubmit]="submit" bit-dialog id="add-edit-folder">
  <span bitDialogTitle>
    {{ title | i18n }}
  </span>
  <div bitDialogContent>
    <bit-form-field disableMargin>
      <bit-label>{{ "folderName" | i18n }}</bit-label>
      <input bitInput id="folderName" formControlName="name" type="text" />
      <bit-hint>
        {{ "folderHintText" | i18n }}
      </bit-hint>
    </bit-form-field>
  </div>
  <ng-container bitDialogFooter>
    <button
      #submitBtn
      bitButton
      buttonType="primary"
      type="submit"
      form="add-edit-folder"
      [disabled]="folderForm.invalid"
    >
      {{ "save" | i18n }}
    </button>
    <button bitButton bitDialogClose buttonType="secondary" type="button">
      {{ "cancel" | i18n }}
    </button>

    @if (variant === "edit") {
      <button
        type="button"
        buttonType="dangerGhost"
        class="tw-ml-auto"
        bitIconButton="bwi-trash"
        [label]="'deleteFolder' | i18n"
        [bitAction]="deleteFolder"
      ></button>
    }
  </ng-container>
</form>
