import { SubmitHandler, useForm } from 'react-hook-form'
import { yupResolver } from '@hookform/resolvers/yup'
import { mobileSchema } from 'utils'
import { useEditUserMutation } from '@/store/services'
import { TextField, SubmitModalBtn, Modal, HandleResponse } from 'components'
const UserMobileModal = props => {
//? Props
const { isShow, onClose, editedData } = props
//? Patch Data
const [editUser, { data, isSuccess, isLoading, error, isError }] = useEditUserMutation()
//? Form Hook
const {
handleSubmit,
control,
formState: { errors: formErrors },
} = useForm({
resolver: yupResolver(mobileSchema),
defaultValues: { mobile: editedData ? editedData : '' },
})
//? Handlers
const submitHander = ({ mobile }) => {
editUser({
body: { mobile },
})
}
//? Render(s)
return (
<>
{/* Handle Edit User Response */}
{(isSuccess || isError) && (
)}
手机号码记录及编辑
请输入您的手机号码
>
)
}
export default UserMobileModal