Sha256: 933c31f9663bb332ef7f5cd1d98142ca7e22c59a25c204a0321e5b8a022edb4d
Contents?: true
Size: 1.14 KB
Versions: 18
Compression:
Stored size: 1.14 KB
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { sprintf, translate as __ } from 'foremanReact/common/I18n'; import ForemanModal from 'foremanReact/components/ForemanModal'; import { foremanUrl } from 'foremanReact/common/helpers'; import { WEBHOOK_DELETE_MODAL_ID } from '../../constants'; const WebhookDeleteModal = ({ toDelete, onSuccess }) => { const { id, name } = toDelete; return ( <ForemanModal id={WEBHOOK_DELETE_MODAL_ID} title={__('Confirm Webhook Deletion')} backdrop="static" enforceFocus submitProps={{ url: foremanUrl(`/api/v2/webhooks/${id}`), message: sprintf(__('Webhook %s was successfully deleted'), name), onSuccess, submitBtnProps: { bsStyle: 'danger', btnText: __('Delete'), }, }} > {sprintf(__('You are about to delete %s. Are you sure?'), name)} <ForemanModal.Footer /> </ForemanModal> ); }; WebhookDeleteModal.propTypes = { toDelete: PropTypes.object, onSuccess: PropTypes.func.isRequired, }; WebhookDeleteModal.defaultProps = { toDelete: {}, }; export default WebhookDeleteModal;
Version data entries
18 entries across 18 versions & 1 rubygems