Proyectos de Subversion LeadersLinked - SPA

Rev

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

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