influxdb/archive/cluster_accounts/components/DeleteUserModal.js

38 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import React, {PropTypes} from 'react';
const DeleteUserModal = React.createClass({
propTypes: {
onConfirm: PropTypes.func.isRequired,
user: PropTypes.shape({
name: PropTypes.string,
}),
},
handleConfirm() {
this.props.onConfirm(this.props.user);
},
render() {
return (
<div className="modal fade" id="deleteUserModal" tabIndex="-1" role="dialog">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header">
<button type="button" className="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 className="modal-title">{this.props.user ? `Are you sure you want to delete ${this.props.user.name}?` : 'Are you sure?'}</h4>
</div>
<div className="modal-footer">
<button className="btn btn-default" type="button" data-dismiss="modal">Cancel</button>
<button className="btn btn-danger js-delete-users" onClick={this.handleConfirm} type="button" data-dismiss="modal">Delete</button>
</div>
</div>
</div>
</div>
);
},
});
export default DeleteUserModal;