UNPKG

react-antd-admin-panel

Version:

Easy prototyping admin panel using React and Antd

21 lines 939 B
import React, { useState } from "react"; import { Button, Modal as ModalAnt } from "antd"; import Section from "../Section"; const Modal = (props) => { const [visible, setVisible] = useState(false); const showModal = () => { setVisible(true); }; const onClose = () => { setVisible(false); }; const onOk = () => { setVisible(false); }; return (React.createElement(React.Fragment, null, React.createElement(Button, { type: "primary", onClick: showModal }, "Open"), React.createElement(ModalAnt, { style: props.model._style, width: props.model._size, mask: props.model._mask, maskClosable: props.model._maskClosable, visible: visible, closable: false, onOk: onOk, onCancel: onClose }, React.createElement(Section, { main: props.main, section: props.model, form: props.form })))); }; export default Modal; //# sourceMappingURL=Modal.js.map