/* eslint-disable react/jsx-indent-props */ /* eslint-disable react/jsx-indent */ /* eslint-disable import/no-absolute-path */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Modal, Button } from 'react-bootstrap'; import { confirmable } from 'react-confirm'; // https://github.com/haradakunihiko/react-confirm/blob/master/example/react-bootstrap/src/components/Confirmation.js class Prompt extends Component { render() { const { show, proceed, dismiss, cancel, confirmation, okBtn, cancelBtn, title, enableEscape = true } = this.props; return (
{title && {title} }

{confirmation}

); } } Prompt.propTypes = { show: PropTypes.bool, // from confirmable. indicates if the dialog is shown or not. proceed: PropTypes.func, // from confirmable. call to close the dialog with promise resolved. cancel: PropTypes.func, // from confirmable. call to close the dialog with promise rejected. dismiss: PropTypes.func, // from confirmable. call to only close the dialog. confirmation: PropTypes.string, // arguments of your confirm function title: PropTypes.string, okBtn: PropTypes.string.isRequired, cancelBtn: PropTypes.string.isRequired, enableEscape: PropTypes.bool }; Prompt.defaultProps = { }; export default confirmable(Prompt);