export * from '@theme/types/widgets';
import { SignInOptions } from 'next-auth/react';

/**
 * Form types for authentication
 */
export enum FormType {
  login = 'login',
  register = 'register',
  loyaltyRegister = 'loyaltyRegister',
  otpLogin = 'otpLogin'
}

/**
 * Extended SignInOptions with additional form type support for Project Zero Next authentication
 *
 * @example
 * ```typescript
 * // For standard login
 * signIn('default', {
 *   ...data,
 *   formType: FormType.login
 * } as PzSignInOptions);
 *
 * // For standard user registration
 * signIn('default', {
 *   ...data,
 *   formType: FormType.register
 * } as PzSignInOptions);
 *
 * // For loyalty program registration
 * signIn('default', {
 *   ...data,
 *   formType: FormType.loyaltyRegister
 * } as PzSignInOptions);
 *
 * // For OTP login
 * signIn('default', {
 *   ...data,
 *   formType: FormType.otpLogin
 * } as PzSignInOptions);
 * ```
 */
export interface PzSignInOptions extends SignInOptions<boolean> {
  /**
   * Type of the authentication form being submitted
   *
   * Available options:
   * - `FormType.login` - Standard email/password login
   * - `FormType.register` - Standard user registration
   * - `FormType.loyaltyRegister` - Loyalty program registration (use this for loyalty signups)
   * - `FormType.otpLogin` - OTP-based login via SMS
   */
  formType?: FormType;
}

export type RegisterFormType = {
  email: string;
  first_name: string;
  last_name: string;
  password: string;
  phone: string;
  confirm: boolean;
  kvkk_confirm: boolean;
  email_allowed: boolean;
  sms_allowed: boolean;
  formType: FormType;
  locale: string;
};

export type LoginFormType = {
  email: string;
  password: string;
  formType: FormType;
  locale: string;
};

export type OtpLoginFormType = {
  phone: string;
  code?: string;
  locale: string;
  formType: FormType;
};

export enum WIDGET_TYPE {
  category = 'category',
  multiselect = 'multiselect'
}

export interface CreditCardForm {
  card_holder: string;
  card_number: string;
  card_month: string;
  card_year: string;
  card_cvv: string;
  installment: number;
  agreement: boolean;
  save?: boolean;
}

export interface PriceProps {
  currencyCode?: string;
  useCurrencySymbol?: boolean;
  useCurrencyAfterPrice?: boolean;
  useCurrencySpace?: boolean;
  useNegative?: boolean;
  useNegativeSpace?: boolean;
}

export interface SeoProps {
  title?: string;
  description?: string;
  keywords?: string;
  itemPropName?: string;
  itemPropDescription?: string;
  itemPropImage?: string;
  twitterCard?: string;
  twitterTitle?: string;
  twitterDescription?: string;
  twitterData1?: string;
  twitterLabel1?: string;
  ogTitle?: string;
  ogImage?: string;
  ogDescription?: string;
  ogPriceAmount?: string;
  ogPriceCurrency?: string;
}

export interface ModalProps {
  portalId: string;
  children?: React.ReactNode;
  open?: boolean;
  setOpen?: (open: boolean) => void;
  title?: React.ReactNode;
  showCloseButton?: React.ReactNode;
  className?: string;
  overlayClassName?: string;
  headerWrapperClassName?: string;
  titleClassName?: string;
  closeButtonClassName?: string;
  iconName?: string;
  iconSize?: number;
  iconClassName?: string;
}
