Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2847 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

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