CreateForm.tsx 524 B

1234567891011121314151617181920212223242526
  1. import { Modal } from 'antd';
  2. import React, { PropsWithChildren } from 'react';
  3. interface CreateFormProps {
  4. modalVisible: boolean;
  5. onCancel: () => void;
  6. }
  7. const CreateForm: React.FC<PropsWithChildren<CreateFormProps>> = (props) => {
  8. const { modalVisible, onCancel } = props;
  9. return (
  10. <Modal
  11. destroyOnClose
  12. title="新建"
  13. width={420}
  14. open={modalVisible}
  15. onCancel={() => onCancel()}
  16. footer={null}
  17. >
  18. {props.children}
  19. </Modal>
  20. );
  21. };
  22. export default CreateForm;