/* eslint-disable no-console */ import { Modal, ModalHeader, ModalTitle } from "@/components/ui/modal/modal"; import { useModal } from "@/components/ui/modal/modal.hook"; import { OtpModal } from "@/components/widget/payment/otp-modal/otp-modal"; import { useLocale } from "@/hooks/useLocale"; import { useMasterpassStore } from "@/store/masterpass-store/use-masterpass-store"; import { MasterpassLoading } from "./masterpass-loading"; interface MasterpassOtpModalProps { setValidationCode: (value: string) => void; loading: boolean; closeModal?: () => void; onResendButton: () => void; } const MasterpassOtpModal = (props: MasterpassOtpModalProps) => { const { closeModal, modalOpen } = useModal({ open: true }); const { masterpassState } = useMasterpassStore(); const { t } = useLocale(); return ( { if (props.closeModal) { props.closeModal(); closeModal(); } else { closeModal(); } }} shouldCloseOnOverlayClick={false} header={ {t("Phone Number Verification")} } footer > {props.loading ? (
) : (
{t("Enter the verification code sent to {{phone}}.", { phone: masterpassState.data?.payload?.masterpassUserData.msisdn!.substring( 1, ), })}
{ props.setValidationCode(validationCode); }} />
)}
); }; export { MasterpassOtpModal };