import {
  DialogSettings,
  KeyValueDTOOfStringAndString,
} from '@generated/swagger/crm-api';

export interface DialogModel<T = any> {
  actions?: Array<KeyValueDTOOfStringAndString>;
  actionsRequired?: number;
  area?: string;
  content?: string;
  description?: string;
  settings?: DialogSettings;
  subtitle?: string;
  title?: string;
  context?: T;
  /**
   * default: true
   */
  handleCommand?: boolean;
  /**
   * If true, URLs in the content will be displayed as QR codes.
   * default: false
   */
  showUrlAsQrCode?: boolean;
}

/**
 * Result of parsing content for URLs
 */
export interface ParsedDialogContent {
  /** Text before the URL */
  textBefore: string;
  /** The extracted URL (if any) */
  url: string | null;
  /** Text after the URL */
  textAfter: string;
}
