content: import React from 'react';
  import { connect } from 'react-redux';
  import { ListGroup, ListGroupItem, Badge, Button } from 'reactstrap';
  import { adminDeleteUser, adminPromoteUser } from '../reducers/admin';
  
  
  const adminUsers = ({users, adminDeleteUser, adminPromoteUser}) => {
    return (
      <div>
        <ListGroup>
          {
            users && users.map((user) => {
              return <ListGroupItem key={user.id} className="justify-content-between">
                {user.name}
                  {
                    user.isAdmin ? null : <Button className="success" onClick={() => adminPromoteUser(user)}>Promote</Button>
                  }
                <Button className="danger" onClick={() => adminDeleteUser(user)}>Delete</Button>
              </ListGroupItem>
            })
          }
        </ListGroup>
      </div>
    );
  }
  
  const mapStateToProps = ({admin}) => ({users: admin.allUsers});
  const mapDispatchToProps = {adminDeleteUser, adminPromoteUser};
  
  export default connect(mapStateToProps, mapDispatchToProps)(adminUsers);
  