Rev 11230 | AutorÃa | Ultima modificación | Ver Log |
import React, { useState } from 'react'
import DeleteModal from '../../shared/DeleteModal'
const CommentTemplate = ({ feed_comment, deleteComment }) => {
const [showDeleteModal, setShowDeleteModal] = useState(false)
const closeModal = () => setShowDeleteModal(false)
return (
<>
<div className="d-flex position-relative mb-1">
<div className="comment-list w-100 p-2 rounded">
<div className={`comment comment-${feed_comment.unique}`}>
<div className={'commentHeader'}>
<img
src={feed_comment.user_image}
alt="user-image"
className={'userImage'}
/>
<div className={'info'}>
<a href={feed_comment.user_url}>
<h3>{feed_comment.user_name}</h3>
</a>
<span>
<img
src="/images/clock.png"
alt=""
style={{ marginRight: '.2rem' }}
/>
{feed_comment.time_elapsed}
{
feed_comment.link_delete
&&
<i className='fa fa-trash ms-2' onClick={() => setShowDeleteModal(true)} style={{ cursor: 'pointer' }} />
}
</span>
</div>
</div>
<p>{feed_comment.comment}</p>
</div>
</div>
</div>
<DeleteModal
url={feed_comment.link_delete}
isOpen={showDeleteModal}
closeModal={closeModal}
title="Esta seguro de borrar este comentario?"
onComplete={() => deleteComment(feed_comment.unique)}
message="El comentario ha sido borrado"
/>
</>
)
}
export default CommentTemplate