Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
2846 stevensc 1
import React from 'react'
2847 stevensc 2
import { styled } from '@mui/material'
1650 stevensc 3
 
2845 stevensc 4
import CommentItem from './comment-item'
5
import EmptySection from '@components/UI/EmptySection'
1650 stevensc 6
 
2847 stevensc 7
const CommentsContainer = styled('div')(({ theme }) => ({
8
  display: 'flex',
9
  flexDirection: 'column',
10
  gap: theme.spacing(0.5),
11
  maxHeight: '300px',
12
  overflow: 'auto'
13
}))
14
 
2846 stevensc 15
export default function CommentsList({ comments = [], onDelete, onReport }) {
2845 stevensc 16
  if (!comments.length) {
17
    return <EmptySection message='No hay comentarios' />
18
  }
19
 
2847 stevensc 20
  return (
21
    <CommentsContainer>
22
      {comments.map((comment) => (
23
        <CommentItem
24
          key={comment.unique}
25
          comment={comment}
26
          onDelete={onDelete}
27
          onReport={onReport}
28
        />
29
      ))}
30
    </CommentsContainer>
31
  )
2185 stevensc 32
}