import { DatePicker, Modal } from 'antd';
import dayjs from 'dayjs';

import { useState } from 'react';
const SaveModal = ({ loading, open, onCancel, onOk }) => {
  const [date, setDate] = useState(dayjs());
  const onChange = (date, dateString) => {
    console.log(date, dateString);
    setDate(`${dateString}-01`);
  };
  return (
    <Modal
      title="另存为"
      confirmLoading={loading}
      open={open}
      onCancel={onCancel}
      onOk={() => onOk(date)}
    >
      <DatePicker date={date} picker="month" onChange={onChange} />
    </Modal>
  );
};
export default SaveModal;
