import React, { useState, useEffect } from 'react';

import { message, Button,Modal,} from 'antd';
const Toast = (props:any) => {

const {value,onChange}=props
const [visible,setVisible]=useState(false)

const showModal = () => {
  setVisible(true)
  
}

const handleOk = () => {  
  setVisible(false)
  onChange()
};

const handleCancel = () => {
  setVisible(false)
};

  return (
    <>
      <Button type="primary" onClick={showModal}>
        Open Modal
      </Button>
      <Modal title="Basic Modal" visible={visible} onOk={handleOk} onCancel={handleCancel}>
        <p>Some contents...</p>
        <p>Some contents...</p>
        <p>Some contents...</p>
      </Modal>
    </>
  );
};

export default Toast;
