import { Button, Drawer, Modal } from "antd";
import React, { useContext, useEffect, useState } from "react";

import { UserEditorContext } from "./usermenu";
import UserForm from "./user-form";

export default function UserEditModal() {
	const { formLoading, modalOpen, setModalOpen, form } =
		useContext(UserEditorContext);
	const handleOk = () => {
		form.submit();
	};
	return (
		<Modal
			width={400}
			onOk={handleOk}
			open={modalOpen}
			confirmLoading={formLoading}
			onCancel={() => {
				setModalOpen(false);
			}}
			title={"编辑个人信息"}>
			<UserForm />
		</Modal>
	);
}
