Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
7427 stevensc 1
import React, { useState } from 'react'
2
import DeleteModal from '../../shared/DeleteModal'
11228 stevensc 3
import styles from '../../assets/styles/feedCommentTemplate.module.scss'
7256 stevensc 4
 
7498 stevensc 5
const CommentTemplate = ({ feed_comment, deleteComment }) => {
7256 stevensc 6
 
11228 stevensc 7
	const [showDeleteModal, setShowDeleteModal] = useState(false)
7427 stevensc 8
 
11228 stevensc 9
	const closeModal = () => setShowDeleteModal(false)
7427 stevensc 10
 
11228 stevensc 11
	return (
12
		<>
11230 stevensc 13
			<div className="d-flex position-relative mb-1">
11229 stevensc 14
				<div className="comment-list w-100 p-2 rounded">
11228 stevensc 15
					<div className={`comment comment-${feed_comment.unique}`}>
16
						<div className={styles.commentHeader}>
17
							<img
18
								src={feed_comment.user_image}
19
								alt="user-image"
20
								className={styles.userImage}
21
							/>
22
							<div className={styles.info}>
23
								<a href={feed_comment.user_url}>
24
									<h3>{feed_comment.user_name}</h3>
25
								</a>
26
								<span>
27
									<img
28
										src="/images/clock.png"
29
										alt=""
30
										style={{ marginRight: '.2rem' }}
31
									/>
32
									{feed_comment.time_elapsed}
33
									{
34
										feed_comment.link_delete
35
                                        &&
11229 stevensc 36
                                        <i className='fa fa-trash ms-2' onClick={() => setShowDeleteModal(true)} style={{ cursor: 'pointer' }} />
11228 stevensc 37
									}
38
								</span>
39
							</div>
40
						</div>
41
						<p>{feed_comment.comment}</p>
42
					</div>
43
				</div>
44
			</div>
45
			<DeleteModal
46
				url={feed_comment.link_delete}
47
				isOpen={showDeleteModal}
48
				closeModal={closeModal}
49
				title="Esta seguro de borrar este comentario?"
50
				onComplete={() => deleteComment(feed_comment.unique)}
51
				message="El comentario ha sido borrado"
52
			/>
53
		</>
54
	)
7256 stevensc 55
}
56
export default CommentTemplate