Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
7065 stevensc 1
import React from 'react'
2
import {
3
  Card,
4
  CardActions,
5
  CardContent,
6
  CardMedia,
7
  IconButton,
8
  Typography,
9
} from '@mui/material'
10
import { Delete, Edit } from '@mui/icons-material'
11
import { Link } from 'react-router-dom'
12
import styled from 'styled-components'
13
 
14
const KnowledgeCard = styled(Card)`
15
  background-color: var(--bg-color);
16
  border-radius: var(--border-radius);
17
  overflow: hidden;
18
  height: fit-content;
19
`
20
 
21
const KnowledgeItem = ({
22
  link_delete,
23
  link_view,
24
  link_edit,
25
  category,
26
  description,
27
  image,
28
  title,
29
  onEdit,
30
  onDelete,
31
}) => {
32
  return (
33
    <KnowledgeCard>
34
      <CardMedia
35
        component="img"
36
        height="194"
37
        image={image}
38
        alt={`${title} image`}
39
      />
40
      <CardContent>
41
        <Link to={link_view}>
42
          <Typography variant="h5">{title}</Typography>
43
        </Link>
44
        <Typography variant="subtitle1" color="text.secondary">
45
          {category}
46
        </Typography>
47
        <Typography variant="body2" color="text.secondary">
48
          {description}
49
        </Typography>
50
      </CardContent>
51
      <CardActions disableSpacing>
52
        {link_edit && (
53
          <IconButton aria-label="edit" onClick={() => onEdit(link_edit)}>
54
            <Edit />
55
          </IconButton>
56
        )}
57
        {link_delete && (
58
          <IconButton aria-label="delete" onClick={() => onDelete(link_delete)}>
59
            <Delete />
60
          </IconButton>
61
        )}
62
      </CardActions>
63
    </KnowledgeCard>
64
  )
65
}
66
 
67
export default KnowledgeItem