Rev 7806 | Rev 8150 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useState } from "react";
import DeleteModal from "../../../shared/DeleteModal";
const Follower = ({ first_name, last_name, email, actions, allowDelete, deleteFollower }) => {
const [showDeleteModal, setShowDeleteModal] = useState(false)
const closeModal = () => setShowDeleteModal(false)
return (
<>
<div className="col-4 mb-2">
<div className="card shadow-none text-center h-100">
<div className="card-body p-2 pb-0">
<h6 className="mb-1 mt-3">
<a href={actions.link_profile}>
{`${first_name} ${last_name}`}
</a>
</h6>
<p className="mb-0 small lh-sm">
{email}
</p>
</div>
<div className="card-footer p-2 border-0 d-flex justify-content-center gap-2">
<button
className="btn btn-block btn-primary">
<a href={actions.link_profile} className="text-white">
Ver Perfil
</a>
</button>
{
allowDelete
&&
<button
className="btn btn-block btn-danger"
style={{ marginTop: '0' }}
onClick={() => setShowDeleteModal(true)}
>
Borrar
</button>
}
</div>
</div>
</div>
<DeleteModal
url={actions.link_delete}
isOpen={showDeleteModal}
closeModal={closeModal}
title={`Esta seguro de eliminar a ${first_name} de su lista de seguidores?`}
onComplete={() => deleteFollower(email)}
message={`Seguidor eliminado`}
/>
</>
)
}
export default React.memo(Follower);