Rev 3545 | Rev 3665 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useCallback } from 'react';import { List } from '..';import { CommentItem } from './CommentItem';export function CommentList({ comments = [], onDelete, onReport }) {const handleDelete = useCallback((url, uuid) => {if (!url || !uuid) return;onDelete(url, uuid);},[onDelete]);const handleReport = useCallback((url) => {if (!url) return;onReport(url);},[onReport]);return (<Listitems={comments}renderItem={(comment) => (<CommentItemcomment={comment}onDelete={comment.link_delete ? () => handleDelete(comment.link_delete, comment.uuid) : null}onReport={comment.link_abuse_report ? () => handleReport(comment.link_abuse_report) : null}/>)}emptyMessage='No hay comentarios para mostrar'keyExtractor={(comment) => comment.uuid}/>);}