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

import { ButtonComponent } from '@isa/ui/buttons';

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

/**
 * Input data for the message dialog
 */
export interface ConfirmationDialogData {
  /** The message text to display in the dialog */
  message: string;
  /** Optional custom text for the close button (defaults to "Close" or equivalent) */
  closeText?: string;

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

export interface ConfirmationDialogResult {
  /** Indicates whether the user confirmed the action (true) or closed the dialog (false) */
  confirmed: boolean;
}

/**
 * Simple message dialog component
 * Used for displaying informational messages to the user
 * Returns void when closed (no result)
 */
@Component({
  selector: 'ui-confirmation-dialog',
  templateUrl: './confirmation-dialog.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [ButtonComponent],
})
export class ConfirmationDialogComponent extends DialogContentDirective<
  ConfirmationDialogData,
  ConfirmationDialogResult
> {}
