import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; import { compose } from 'redux'; import { deleteServer } from './reducers/server'; import { serverType } from './prop-types'; export const DeleteServerModal = ({ server, toggle, isOpen, deleteServer, history }) => { const closeModal = () => { deleteServer(server); toggle(); history.push('/'); }; return ( Delete server

Are you sure you want to delete server {server ? server.name : ''}?

No data will be deleted, only the access to that server will be removed from this host. You can create it again at any moment.

); }; DeleteServerModal.propTypes = { toggle: PropTypes.func.isRequired, isOpen: PropTypes.bool.isRequired, server: serverType, }; export default compose( withRouter, connect(null, { deleteServer }) )(DeleteServerModal);