import React, { FC, useRef, useState } from 'react' import { useGuardContext } from 'src/context/global/context' import { CheckPhoneForm } from './CheckPhoneForm' import { VerifyCodeForm } from './VerifyCodeForm' import { SmsMFAFormProps } from '../../types' export const SmsMfaVerifyForm: FC = ({ onSuccess, onFail, }) => { const { state: { mfaData: { mfaToken, phone: userPhone }, }, } = useGuardContext() const [phone, setPhone] = useState(userPhone) const sendCodeRef = useRef(null) return ( <> {phone ? ( ) : ( { setPhone(phone) sendCodeRef.current?.click() }} > )} ) }