import { AUTH_FLOW_STATUS } from "../../../../overmind/auth/state"; import { Button, Input } from "antd"; import { CrossCircleErr } from "../../../User/UserCreate"; import { FormInstance } from "antd"; import { NLView } from "../../../../types"; import { isEmpty } from "lodash"; import { layout } from "../../Auth"; import { phoneNumberReformat } from "../../../../utils/phoneNumberReformat"; import { useActions, useAppState } from "../../../../overmind"; import { useState } from "react"; import Form from "antd/lib/form"; const PhoneForm: NLView<{ setIsErrorSubmit: React.Dispatch> | undefined; embedded: boolean | undefined; phoneForm: FormInstance; }> = ({ setIsErrorSubmit, embedded, phoneForm }) => { const state = useAppState(); const actions = useActions(); const phoneNumArr = state.flows.user.create.form.phone?.split(""); const maskedPhoneNum = phoneNumArr ?.map((char, i) => { if (i < phoneNumArr.length - 3 && i > 3) { return "X"; } return char; }) .join(""); const isPhonePresent = !isEmpty(state.flows.user.create.form.phone); const reg = "^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,7}$"; return ( ); }; export default PhoneForm;