import { ChangeDetectionStrategy, Component } from '@angular/core';

import { DialogContentDirective } from '../dialog-content.directive';

import {
  NumberInputComponent,
  NumberInputValidation,
} from './number-input.component';

/**
 * Input data for the number input dialog
 */
export interface NumberInputDialogData {
  /** The message text to display in the dialog */
  message: string;

  /** Optional submessage text to display in the dialog */
  subMessage?: string;

  /** Optional value to display in the submessage */
  subMessageValue?: string;

  /** The input field label to display */
  inputLabel?: string;

  /** Value of the input */
  inputValue?: number;

  /** The input field default value */
  inputDefaultValue?: number;

  /** Optional validation for the input field */
  inputValidation?: NumberInputValidation[];

  /** Optional custom text for the close button (defaults to "Verlassen" or equivalent) */
  closeText?: string;

  /** Optional custom text for the confirm button (defaults to "Speichern" or equivalent) */
  confirmText?: string;
}

export interface NumberInputDialogResult {
  /** The value entered in the input field */
  inputValue?: number;
}

/**
 * Number input dialog component
 * Used for collecting numeric input from the user
 * Returns the numeric value when confirmed
 */
@Component({
  selector: 'ui-number-input-dialog',
  templateUrl: './number-input-dialog.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [NumberInputComponent],
})
export class NumberInputDialogComponent extends DialogContentDirective<
  NumberInputDialogData,
  NumberInputDialogResult
> {}
