import { FC } from 'react';
import { Form, Modal, ModalProps, Select } from 'antd';
import { CommonAPI } from '~/api';

interface selfProps {
  onOk: () => void;
}
const AddPeopleModal: FC<ModalProps & selfProps> = ({ open, onCancel, onOk }) => {
  const handleOk = () => {
    onOk();
  };
  //select 搜索
  const selectSearchEvent = (value: string) => {
    CommonAPI.getUserAccountByPhoneNum({ phoneNum: value }).then(({ result }) => {});
  };

  return (
    <Modal open={open} title='添加成员' onOk={handleOk} onCancel={onCancel}>
      <Form>
        <Form.Item label='成员'>
          <Select placeholder='请输入成员手机号码' showSearch onSearch={selectSearchEvent}></Select>
        </Form.Item>
      </Form>
    </Modal>
  );
};

export default AddPeopleModal;
