Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15193 | Rev 15203 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
11121 stevensc 1
import React, { useState } from 'react'
2
import DeleteModal from '../../../shared/DeleteModal'
7545 stevensc 3
 
7806 stevensc 4
const Follower = ({ first_name, last_name, email, actions, allowDelete, deleteFollower }) => {
7573 stevensc 5
 
11121 stevensc 6
	const [showDeleteModal, setShowDeleteModal] = useState(false)
7806 stevensc 7
 
11121 stevensc 8
	const closeModal = () => setShowDeleteModal(false)
7806 stevensc 9
 
11121 stevensc 10
	return (
11
		<>
12
			<div className="col-md-3 col-sm-6 col-12">
15193 stevensc 13
				<div className="company_profile_info">
15195 stevensc 14
					<div className="row mb-2">
15
						<div className="d-flex flex-column mb-2 justify-content-center align-items-center">
16
							<h3 className="mb-1">
17
								{`${first_name} ${last_name}`}
18
							</h3>
19
							<p className="mb-0">
20
								{email}
21
							</p>
11121 stevensc 22
						</div>
15195 stevensc 23
					</div>
24
					<ul>
25
						{/* <li>
11121 stevensc 26
								<button className="btn btn-primary">
27
									<a href={actions.link_profile} className="btn p-0">
11217 stevensc 28
										Ver perfil
11121 stevensc 29
									</a>
30
								</button>
11217 stevensc 31
							</li> */}
15195 stevensc 32
						{allowDelete &&
33
							<li>
34
								<button className="btn btn-tertiary" onClick={() => setShowDeleteModal(true)}>
35
									Borrar
36
								</button>
37
							</li>
38
						}
39
					</ul>
11121 stevensc 40
				</div>
41
			</div>
42
			<DeleteModal
43
				url={actions.link_delete}
44
				isOpen={showDeleteModal}
45
				closeModal={closeModal}
46
				title={`Esta seguro de eliminar a ${first_name} de su lista de seguidores?`}
47
				onComplete={() => deleteFollower(email)}
48
				message={'Seguidor eliminado'}
49
			/>
50
		</>
51
	)
7806 stevensc 52
}
7545 stevensc 53
 
11121 stevensc 54
export default React.memo(Follower)