Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
3550 stevensc 1
import React from 'react';
2
import { Link } from 'react-router-dom';
3
import { Box, Button, styled, Typography } from '@mui/material';
4
import { NavigateNext } from '@mui/icons-material';
5
 
6
import { Card, CardContent } from '@shared/components';
7
import { parse } from '@shared/utils';
8
 
9
const CardImage = styled('img')(({ theme }) => ({
10
  borderRadius: theme.shape.borderRadius,
11
  maxWidth: 100,
12
  aspectRatio: '1/1.5',
13
  objectFit: 'cover'
14
}));
15
 
16
export function CapsuleCard({ capsule: { name, description, image, completed, uuid } }) {
17
  return (
18
    <Card>
19
      <CardContent>
20
        <Box
21
          sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 0.5 }}
22
        >
23
          <Box>
24
            <Typography variant='caption'>{completed ? 'Completa' : 'En curso'}</Typography>
25
            <Typography variant='h2'>{name}</Typography>
26
            <Typography>{parse(description)}</Typography>
27
 
28
            <Button LinkComponent={Link} to={`/microlearning/capsules/${uuid}/slides`}>
29
              Ver cápsula
30
              <NavigateNext fontSize='small' />
31
            </Button>
32
          </Box>
33
 
34
          <CardImage src={image} alt={name} />
35
        </Box>
36
      </CardContent>
37
    </Card>
38
  );
39
}