import { type Dispatch, type SetStateAction } from 'react';

export enum Gender {
  None = 0,
  Female = 1,
  Male = 2,
}

export interface ValidationProps {
  errors: { [key: string]: string };
  touched: { [key: string]: boolean };
  handleBlur: (field: string) => void;
}

export interface DateOfBirthProps {
  value: Date | null;
  onChange: (date: Date | null) => void;
}

export interface EmailSectionProps extends ValidationProps {
  showEmail: boolean;
  setShowEmail: (checked: boolean) => void;
  email: string;
  setEmail: (email: string) => void;
  correctEmail: boolean;
  codeSent: boolean;
  verificationCode: string;
  setVerificationCode: (code: string) => void;
  buttonState: 'default' | 'counting' | 'sent';
  countdown: number;
  handleSendCode: () => void;
  handleVerifyCode: () => void;
  emailVerified: boolean;
  isVerifyingCode: boolean;
  isSendingCode: boolean;
  handleEditEmail: () => void;
}

export interface PasswordSectionProps extends ValidationProps {
  showPasswordSection: boolean;
  setShowPasswordSection: (checked: boolean) => void;
  password: string;
  setPassword: (password: string) => void;
  confirmPassword: string;
  setConfirmPassword: (confirmPassword: string) => void;
  matchPassword: boolean;
  hasNumber: boolean;
  hasMinLength: boolean;
  hasUpperAndLower: boolean;
  hasSpecialChar: boolean;
  validPassword: boolean;
}

export interface ValidationItemProps {
  isValid: boolean;
  label: string;
}

export interface PersonalInfoFieldsProps extends ValidationProps {
  firstName: string;
  setFirstName: (v: string) => void;
  lastName: string;
  setLastName: (v: string) => void;
  sex: Gender | null;
  setSex: Dispatch<SetStateAction<Gender | null>>;
  country: string;
  setCountry: (country: string) => void;
  nationalId: string;
  setNationalId: (v: string) => void;
  birthDate: Date | null;
  setBirthDate: (d: Date | null) => void;
}

export interface SubmitProps {
  loading: boolean;
}
