text: import React, { useState } from 'react';
  import { Dropdown } from 'semantic-ui-react';
  import PropTypes from 'prop-types';
  import { injectIntl } from 'react-intl';
  import messages from '../../Messages';
  
  const DeleteModal = (props) => {
      const { intl, type, instance, DeleteTypeModal } = props;
      const [open, setOpen] = useState(false);
  
      const handleClose = () => {
          setOpen(false);
      };
  
      const optionMenuItem = <Dropdown.Item
          text={intl.formatMessage(messages.deleteOptionMenu, { name: intl.formatMessage(type) })}
          className='item-red'
          onClick={() => setOpen(true)}
      />;
  
      return <>
          {optionMenuItem}
          <DeleteTypeModal
              handleClose={handleClose}
              instance={instance}
              open={open}
          />
      </>;
  };
  
  DeleteModal.propTypes = {
      intl: PropTypes.any,
      type: PropTypes.any,
      instance: PropTypes.object,
      DeleteTypeModal: PropTypes.elementType
  };
  
  export default injectIntl(DeleteModal);
  