import { Input, Modal } from 'antd';
import { useRef, useState } from 'react';

const AddFileModal = ({ id, visible, handleOk, handleCancel }) => {
  const [value, setValue] = useState('新建文件夹');

  const onChange = () => {
    console.log(value);
    handleOk?.({ id, dir_name: value });
  };
  return (
    <Modal
      title="新建文件夹"
      open={visible}
      onOk={onChange}
      onCancel={handleCancel}
      destroyOnClose
    >
      <div
        style={{ display: 'flex', whiteSpace: 'nowrap', alignItems: 'center' }}
      >
        文件名：
        <Input
          defaultValue={'新建文件夹'}
          onChange={(e) => setValue(e.target.value)}
        />
      </div>
    </Modal>
  );
};
export default AddFileModal;
