<mat-dialog-content>
  @if (isConfigReady()) {
    <datetime-picker
      [selectedDate]="selectedDate"
      [selectedTime]="selectedTime"
      [selectedReminderCfgId]="selectedReminderCfgId"
      [reminderOptions]="reminderOptions"
      [minDate]="minDate"
      [timeLabel]="T.F.TASK.D_DEADLINE.ADD_TIME | translate"
      [reminderLabel]="T.F.TASK.D_DEADLINE.REMIND_AT"
      [quickAccessTranslationPrefix]="'F.TASK.D_DEADLINE'"
      (dateSelected)="dateSelected($event)"
      (timeChanged)="selectedTime = $event"
      (reminderChanged)="selectedReminderCfgId = $event"
      (quickAccessClick)="onQuickAccessClick($event)"
      (enterSubmit)="submit()"
    ></datetime-picker>
  }

  <mat-dialog-actions align="start">
    <div class="deadline-actions">
      @if (hasExistingDeadline && !data.isSelectDeadlineOnly) {
        <button
          (click)="remove()"
          color="warn"
          mat-stroked-button
          type="button"
        >
          <mat-icon>event_busy</mat-icon>
          {{ T.F.TASK.D_DEADLINE.REMOVE_DEADLINE | translate }}
        </button>
      }
      <button
        color="primary"
        mat-flat-button
        [disabled]="!selectedDate"
        (click)="submit()"
        type="button"
      >
        <mat-icon>event_available</mat-icon>
        {{ T.F.TASK.D_DEADLINE.SET_DEADLINE | translate }}
      </button>
    </div>
    <button
      class="dialog-cancel-btn"
      mat-button
      (click)="close()"
      type="button"
    >
      {{ T.G.CANCEL | translate }}
    </button>
  </mat-dialog-actions>
</mat-dialog-content>
