Created
March 10, 2021 17:38
-
-
Save alex-boom/6a1ffaae04753bd043415b35d3700121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { Button, Modal } from "antd"; | |
const EditModal = ({ children, nameBtn = 'Button', titleModal = 'Modal Title' }) => { | |
const [ modalVisible, setModalVisible ] = useState(false); | |
return ( | |
<> | |
<Button className='ml-auto' type="primary" onClick={ () => setModalVisible(true) }>{ nameBtn }</Button> | |
<Modal | |
title={ titleModal } | |
centered | |
visible={ modalVisible } | |
onOk={ () => setModalVisible(false) } | |
onCancel={ () => setModalVisible(false) } | |
> | |
{ children } | |
</Modal> | |
</> | |
) | |
} | |
export default EditModal; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment