Rev 7427 | AutorÃa | Ultima modificación | Ver Log |
import React, { useState } from 'react'
import DeleteModal from '../../shared/DeleteModal'
const CommentTemplate = ({ feed_comment }) => {
const [showDeleteModal, setShowDeleteModal] = useState(false)
const closeModal = () => setShowDeleteModal(false)
return (
<>
<div className="d-flex position-relative">
<div className="avatar avatar-xs">
<a href={feed_comment.user_url}>
<img
className="avatar-img rounded-circle"
src={feed_comment.user_image}
alt="comment user image"
/>
</a>
</div>
<div className="ms-2 mb-2">
<div className="bg-light rounded-start-top-0 p-3 rounded">
<div className="d-flex justify-content-start flex-column">
<h6 className="mb-0">
<a href={feed_comment.user_url}>
{feed_comment.user_name}
</a>
</h6>
<div className="d-flex justify-content-start mb-1">
<small>{feed_comment.time_elapsed}</small>
<i
className='fa fa-trash ms-2 btn'
onClick={() => setShowDeleteModal(true)}
/>
</div>
</div>
<p className="small mb-0">
{feed_comment.comment}
</p>
</div>
</div>
</div>
<DeleteModal
url={feed_comment.link_delete}
isOpen={showDeleteModal}
closeModal={closeModal}
title="Esta seguro de borrar este comentario?"
/>
</>
)
}
export default CommentTemplate