Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
3595 stevensc 1
import React from 'react';
2
import { Typography } from '@mui/material';
3
 
4
import { formatDate } from '@shared/utils';
3596 stevensc 5
import colors from '@styles/config/colors';
3595 stevensc 6
 
7
import { Card, CardContent, CardHeader } from '../card';
8
import { Menu } from '../menu';
9
 
10
export function CommentItem({
11
  comment: { image, fullname, date = '2023-02-04T20:15:12', comment: content },
12
  onDelete,
13
  onReport
14
}) {
15
  return (
16
    <Card sx={{ backgroundColor: colors.dark }}>
17
      <CardHeader
18
        avatar={image}
19
        title={fullname}
20
        subheader={formatDate(date)}
21
        renderAction={() => (
22
          <Menu>
23
            {onDelete && <Menu.Item onClick={onDelete}>Eliminar</Menu.Item>}
24
            {onReport && <Menu.Item onClick={onReport}>Reportar</Menu.Item>}
25
          </Menu>
26
        )}
27
      />
28
 
29
      <CardContent>
30
        <Typography>{content}</Typography>
31
      </CardContent>
32
    </Card>
33
  );
34
}