Sha256: eb969b1d0d39b76cad4bbe3c5208e07d18d89dc6d788faa325c89f210790f858
Contents?: true
Size: 1.04 KB
Versions: 13
Compression:
Stored size: 1.04 KB
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanModalHooks'; import WebhooksTable from './WebhooksTable'; import { WEBHOOK_DELETE_MODAL_ID, WEBHOOK_EDIT_MODAL_ID, } from '../../../constants'; const WrappedWebhooksTable = props => { const { setModalOpen: setDeleteModalOpen } = useForemanModal({ id: WEBHOOK_DELETE_MODAL_ID, }); const { setModalOpen: setEditModalOpen } = useForemanModal({ id: WEBHOOK_EDIT_MODAL_ID, }); const { setToDelete, setToEdit, ...rest } = props; const onDeleteClick = rowData => { setToDelete(rowData); setDeleteModalOpen(); }; const onEditClick = rowData => { setToEdit(rowData); setEditModalOpen(); }; return ( <WebhooksTable onDeleteClick={onDeleteClick} onEditClick={onEditClick} {...rest} /> ); }; WrappedWebhooksTable.propTypes = { setToDelete: PropTypes.func.isRequired, setToEdit: PropTypes.func.isRequired, }; export default WrappedWebhooksTable;
Version data entries
13 entries across 13 versions & 1 rubygems