Proyectos de Subversion LeadersLinked - SPA

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3611 stevensc 1
import React from 'react';
2
import { Typography } from '@mui/material';
3462 stevensc 3
 
3661 stevensc 4
import { parse } from '@shared/utils';
3462 stevensc 5
 
3611 stevensc 6
import { Card, CardContent, CardHeader, CardMedia, Menu } from '@shared/components';
3462 stevensc 7
 
8
export function KnowledgeCard({
3661 stevensc 9
  knowledge: { category, description, image, title, link_edit, link_delete },
3462 stevensc 10
  onEdit,
11
  onDelete
12
}) {
13
  return (
3661 stevensc 14
    <Card>
3611 stevensc 15
      <CardHeader
16
        renderAction={() => (
17
          <Menu>
3661 stevensc 18
            {link_edit && <Menu.Item onClick={() => onEdit(link_edit)}>Editar</Menu.Item>}
19
            {link_delete && <Menu.Item onClick={() => onDelete(link_delete)}>Eliminar</Menu.Item>}
3611 stevensc 20
          </Menu>
21
        )}
22
      />
3462 stevensc 23
 
24
      <CardMedia height={200} src={image} alt={`${title} image`} />
25
 
26
      <CardContent>
27
        <Typography variant='h2'>{title}</Typography>
28
        <Typography variant='overline'>{category}</Typography>
29
        <Typography>{parse(description)}</Typography>
30
      </CardContent>
31
    </Card>
32
  );
33
}