import { Modal, Button } from 'patternfly-react'; import PropTypes from 'prop-types'; import React from 'react'; import { translate as __ } from 'foremanReact/common/I18n'; export class ClickConfirmation extends React.Component { state = { disableConfirm: true }; render() { const { disableConfirm } = this.state; const { title, body, confirmationMessage, confirmAction, path, confirmType, closeModal, showModal, } = this.props; const icon = confirmType === 'warning' ? confirmType : 'exclamation'; return ( {` ${title}`} {body}
{ this.setState({ disableConfirm: !e.target.checked, }); }} type="checkbox" /> {` ${confirmationMessage}`}
); } } ClickConfirmation.propTypes = { showModal: PropTypes.bool, title: PropTypes.string.isRequired, body: PropTypes.string.isRequired, confirmationMessage: PropTypes.string.isRequired, confirmAction: PropTypes.string.isRequired, path: PropTypes.string.isRequired, confirmType: PropTypes.oneOf(['warning', 'danger']), closeModal: PropTypes.func.isRequired, }; ClickConfirmation.defaultProps = { showModal: false, confirmType: 'warning', }; export default ClickConfirmation;