Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3508 | Rev 3535 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3508 Rev 3534
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { Link } from 'react-router-dom';
-
 
3
import { Box, Typography } from '@mui/material';
2
import { Typography } from '@mui/material';
Línea 4... Línea 3...
4
 
3
 
5
import { Card, CardContent } from '../card';
4
import { Card, CardContent, CardHeader } from '../card';
-
 
5
import { Menu } from '../menu';
Línea 6... Línea 6...
6
import { Menu } from '../menu';
6
import colors from '@styles/colors';
7
 
7
 
8
export function CommentItem({
8
export function CommentItem({
9
  comment: { user_url, user_name, time_elapsed, comment: content },
9
  comment: { image, fullname, date, comment: content },
10
  onDelete,
10
  onDelete,
11
  onReport
11
  onReport
-
 
12
}) {
12
}) {
13
  return (
13
  return (
14
    <Card sx={{ backgroundColor: colors.dark }}>
14
    <Card>
15
      <CardHeader
15
      <CardContent>
16
        avatar={image}
16
        <Menu>
17
        title={fullname}
17
          <Menu.Item onClick={onDelete}>Delete</Menu.Item>
18
        subheader={date}
18
          <Menu.Item onClick={onReport}>Report Abuse</Menu.Item>
-
 
19
        </Menu>
19
        renderAction={() => (
20
 
-
 
21
        <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
20
          <Menu>
22
          <Link to={user_url}>
21
            {onDelete && <Menu.Item onClick={onDelete}>Eliminar</Menu.Item>}
23
            <Typography variant='h3'>{user_name}</Typography>
22
            {onReport && <Menu.Item onClick={onReport}>Reportar</Menu.Item>}
24
          </Link>
23
          </Menu>
Línea -... Línea 24...
-
 
24
        )}
25
          <Typography variant='overline'>{time_elapsed}</Typography>
25
      />
26
        </Box>
26
 
27
 
27
      <CardContent>
28
        <Typography>{content}</Typography>
28
        <Typography>{content}</Typography>
29
      </CardContent>
29
      </CardContent>