mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
22 lines
588 B
JavaScript
22 lines
588 B
JavaScript
import React from 'react';
|
|
import Users from 'meteor/vulcan:users';
|
|
import { Components, withRemove } from 'meteor/vulcan:core';
|
|
|
|
const AdminUsersActions = ({ document: user, removeMutation }) =>{
|
|
|
|
const deleteHandler = e => {
|
|
e.preventDefault();
|
|
if (confirm(`Delete user ${Users.getDisplayName(user)}?`)) {
|
|
removeMutation({documentId: user._id});
|
|
}
|
|
};
|
|
|
|
return <Components.Button variant="primary" onClick={deleteHandler}>Delete</Components.Button>;
|
|
};
|
|
|
|
const removeOptions = {
|
|
collection: Users
|
|
};
|
|
|
|
export default withRemove(removeOptions)(AdminUsersActions);
|
|
|